【发布时间】:2019-06-21 10:52:28
【问题描述】:
我在 keras 中创建了 mobilenet v2 模型以及 lambda 函数,该函数为我提供了倒数第二层的输出。如何保存这个特定的子模型(我想用 tfjs-converter 转换它并在 tensorflow-js 中使用它)?
from keras.applications.mobilenet_v2 import MobileNetV2
model = MobileNetV2(input_shape=None, alpha=0.35, depth_multiplier=1, include_top=True, weights='imagenet', input_tensor=None, pooling=None, classes=1000)
get_3rd_layer_output = K.function([model.layers[0].input],
[model.layers[-2].output])
【问题讨论】:
标签: tensorflow keras