I'm following a tutorial and I loaded the pre-trained VGGNet16
model using Keras
vgg16_model = keras.applications.vgg16.VGG16()
model = Sequential()
for layer in vgg16_model.layers:
model.add(layer)
model.layers.pop()
for layer in model.layers:
layer.trainable = False
model.add(Dense(10, activation='softmax', name='predict'))
#model.summary()
I used model.save('path/model_1.h5')
to save the model after training it with model.fit_generator(...)
Then I ran out of time in Colaboratory
. so I wanted to use model = load_model('path/model_1.h5')
to load my model again instead of loading it as I showed previously with vgg16_model = keras.applications.vgg16.VGG16()...
And now I'm having this error:
ValueError: Dimension 0 in both shapes must be equal, but are 4096 and 1000. Shapes are [4096,10] and [1000,10]. for 'Assign_61' (op: 'Assign') with input shapes: [4096,10], [1000,10].
What am I doing wrong? Thanks!