小编che*_*ang的帖子

tf2.1第二次训练如何使用tfhub提供的efficientnet-lite

我使用的版本是 tensorflow-gpu 版本 2.1.0,从 pip 安装。

import tensorflow as tf
import tensorflow_hub as hub

tf.keras.backend.set_learning_phase(True)

module_url = "https://tfhub.dev/tensorflow/efficientnet/lite0/classification/2"

module2 = tf.keras.Sequential([
    hub.KerasLayer(module_url, trainable=False, input_shape=(224,224,3))])

output1 = module2(tf.ones(shape=(1,224,224,3)))
print(module2.summary())
Run Code Online (Sandbox Code Playgroud)

当我设置时trainable = True,操作会报错。那么,我不能在 tf2.1 版本上重新训练它吗?

tensorflow tensorflow-hub

5
推荐指数
1
解决办法
510
查看次数

标签 统计

tensorflow ×1

tensorflow-hub ×1