我使用keras进行转学。 这就是我所做的:
伪代码:
mnet=MobileNet(include_top=False,pooling='max',
weights='imagenet',input_shape=(224,224,3))
my_net = bottle_neck = Input(shape=(1024,))
some_layer = Dense(100 ,activation='relu')(bottle_neck)
...
final_layer=Dense(6,activation='softmax')(prev_layers)
我的目标是连接移动网,而无需培训的我的网又重新遍历 谢谢你
答案 0 :(得分:0)
这在Keras文档中有介绍,请参见https://keras.io/applications/#fine-tune-inceptionv3-on-a-new-set-of-classes
关键是使用基础模型输出作为模型的输入(mnet.output
),并将基础模型的覆盖层设置为trainable = False