Transfer learning, wrong dense layer's shape
问题 I am trying to apply transfer learning to my ANN for image classification. I have found an example of it, and I would personalize the network. Here there are the main blocks of code: model = VGG19(weights='imagenet', include_top=False, input_shape=(224, 224, 3)) batch_size = 16 for layer in model.layers[:5]: layer.trainable = False x = model.output x = Flatten()(x) x = Dense(1024, activation="relu")(x) x = Dense(1024, activation="relu")(x) predictions = Dense(16, activation="sigmoid")(x)