我需要做这段代码正在做的,关于层,权重。。在这种情况下如何进行微调。你知道吗
vgg16_model = VGG16(weights="imagenet", include_top=True)
#remove the top layer
base_model = Model(input=vgg16_model.input,
output=vgg16_model.get_layer("block5_pool").output)
#attach a new top layer
base_out = base_model.output
base_out = Dropout(0.60)(base_out)
base_out = Reshape((25088,))(base_out)
fc2 = Dropout(0.60)(base_out)
top_preds = Dense(1, activation="sigmoid")(fc2)
#freeze weights until the last but one convolution layer (block4_pool)
for layer in base_model.layers[0:14]:
layer.trainable = False
#create new hybrid model
model = Model(input=base_model.input, output=top_preds)
目前没有回答
相关问题 更多 >
编程相关推荐