Skip to content Skip to sidebar Skip to footer

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 cod

Solution 1:

Maybe this simple example can help:

import numpy as np

test = np.array([1,2,3])
print(test.shape) # (3,)test = test[np.newaxis]
print(test.shape) # (1, 3)  

Try apply [np.newaxis] in your train_generator output.

Post a Comment for "Transfer Learning, Wrong Dense Layer's Shape"