I want to use a multi-stream CNN with pre-trained VGG19. I'm getting an error with my code. Please help me out with the correct code.
Here's my code snippet
ecg_cnn =VGG19(weights="imagenet", include_top=False, input_tensor=Input(shape=input_shape,name="ecg"))
for layer in ecg_cnn.layers:
layer.trainable = False
out1= ecg_cnn.output
ppg_cnn = VGG19(weights="imagenet", include_top=False, input_tensor=Input(shape=input_shape,name="ppg"))
for layer in ppg_cnn.layers:
layer.trainable = False
out2= ppg_cnn.output
con = Concatenate()([out1, out2])
out=Flatten()(con)
out=(Dense(4096))(out)
out=(Activation('tanh'))(out)
out=(Dropout(0.4))(out)
# Output Layer
out = Dense(3, activation='softmax')(out)
model = Model(inputs=[ecg_cnn.input, ppg_cnn.input], outputs=[out])
model.compile(loss='categorical_crossentropy',
optimizer='sgd',
metrics=['accuracy'])
The error I get is:
ValueError: The name "block1_conv1" is used 2 times in the model. All layer names should be unique.