小编Oct*_*che的帖子

Keras中用于对象定位提取的MobileNet传输学习 - 以NaN计算的损失

我正在尝试使用Keras及其MobileNet实现进行对象本地化(输出一些特征的x/y坐标,而不是类),我遇到了一些我可能无法弄清楚的非常基本的问题.

我的代码看起来像这样:

# =============================
# Load MobileNet and change the top layers.
model = applications.MobileNet(weights="imagenet",
                               include_top=False,
                               input_shape=(224, 224, 3))

# Freeze all the layers except the very last 5.
for layer in model.layers[:-5]:
  layer.trainable = False

# Adding custom Layers at the end, after the last Conv2D layer.
x = model.output

x = GlobalAveragePooling2D()(x)
x = Reshape((1, 1, 1024))(x)
x = Dropout(0.5)(x)
x = Conv2D(1024, (1, 1), activation='relu', padding='same', name='conv_preds')(x)
x = Dense(1024, activation="relu")(x)

# I'd like this to output …
Run Code Online (Sandbox Code Playgroud)

python keras

7
推荐指数
0
解决办法
1368
查看次数

标签 统计

keras ×1

python ×1