0
我想新的节点添加到输出层以后训练它,我是这样做的:添加到输出层新节点Keras
def add_outputs(self, n_new_outputs):
out = self.model.get_layer('fc8').output
last_layer = self.model.get_layer('fc7').output
out2 = Dense(n_new_outputs, activation='softmax', name='fc9')(last_layer)
output = merge([out, out2], mode='concat')
self.model = Model(input=self.model.input, output=output)
其中'fc7'
是完全连接层输出层'fc8'
前。我执行最后一层out = self.model.get_layer('fc8').output
,但输出是所有模型。 有没有什么办法只从网络上取一层? 也许那里有其他更简单的方式来做到这一点....
谢谢!!!!