连接与keras预训练的模型,没有顶,定制顶级模特

问题描述 投票:0回答:1

我做的转移学习使用keras。这是我做了什么:

  • 载预训练的模型(Mobilnet)没有顶部。
  • 建立一些层的模型,输入是mobilnet的输出,并且输出是SOFTMAX(分类任务)
  • 现在我训练的瓶颈图像作为输入顶级型号(后经过mobilnet)
  • 最后我想顶级模特和mobilnet连接到完整的模型,谁得到的图像和预测分类。

伪代码:

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)

我的目标是连接mobilnet,我不净火车一遍感谢ü

python keras deep-learning transfer-learning
1个回答
-1
投票

这是覆盖Keras文档中,看到https://keras.io/applications/#fine-tune-inceptionv3-on-a-new-set-of-classes

关键的东西是使用作为模型(mnet.output)的输入端的基本模型输出,并且设置基本模型作为trainable = False触及层

© www.soinside.com 2019 - 2024. All rights reserved.