Reputation: 887
I want to build a neural network that has two inputs and uses EfficientNetB1 to extract features and fine-tune on new layers, so I wrote this code:
def createNet(self,shape):
FE1 = K.applications.EfficientNetB1(include_top=False, input_shape=shape)
FE2 = K.applications.EfficientNetB1(include_top=False, input_shape=shape)
inp1 = FE1.input
out1 = FE1.layers[-1].output
inp2 = FE2.input
out2 = FE2.layers[-1].output
merged_out = K.layers.concatenate((out1, out2))
# .... other layers
self.model = K.models.Model(inputs=[inp1, inp2], outputs=[merged_out])
self.model.summary()
But I got this error:
ValueError: The name "stem_conv_pad" is used 2 times in the model. All layer names should be unique.
So how can I build my model?
Upvotes: 1
Views: 278