0

I am training a system with two images using transfer_learning using the VGG16 pretrained network. If I use the weights it gives me an error, I don't know the reason or how to solve it. Any suggestion?

input_shape = (60, 36, 3)
# Declaramos dos capas de Input
input_1 = Input(shape=input_shape)
input_2 = Input(shape=input_shape)
concate_input = Concatenate()([input_1, input_2])
input = layers.Conv2D(6,3, activation="relu") (concate_input)
base_model = applications.VGG16(weights= 'imagenet', include_top=False, input_tensor= 
concate_input)

The error message is:

ValueError: Cannot assign value to variable ' block1_conv1/kernel:0': Shape mismatch.The variable shape (3, 3, 6, 64), and the assigned value shape (64, 3, 3, 3) are incompatible.

Thanks a lot¡¡

I'mahdi
  • 23,382
  • 5
  • 22
  • 30
  • Does this answer your question? [VGG16 Network for Multiple Inputs Images](https://stackoverflow.com/questions/66973552/vgg16-network-for-multiple-inputs-images) – Innat Apr 07 '22 at 15:28
  • In the above link, just check the `layer.Conv2D` after the `Input` layer. You may need to fix yours accordingly. – Innat Apr 07 '22 at 15:32
  • Hi, VGG16 Network for Multiple Inputs Images has the weight = none. does not solve the problem. – Manuel Soengas Núñez Apr 07 '22 at 15:58
  • In the above link, just check the layer.Conv2D after the Input layer. You may need to fix yours accordingly. ¿¿¿ I do not understand your answer. – Manuel Soengas Núñez Apr 07 '22 at 16:01
  • replace your con2d with `layers.Conv2D(3, (3, 3), padding='same', activation="relu")`. – Innat Apr 07 '22 at 17:04
  • Change the error. Layer count mismatch when loading weights from file. Model expected 14 layers, found 13 saved layers. Can I send to you colab link? – Manuel Soengas Núñez Apr 08 '22 at 16:58

0 Answers0