I am running a model on Colab pro.
Getting an error:
ValueError: You are trying to load a weight file containing 23 layers into a model with 50 layers.
This is a common problem, which is still not resolved on GitHub.
https://github.com/keras-team/keras/issues/10417
My versions
Tensorflow version 2.4.0 Keras version 2.4.2
My original model works fine, but when I add layers, it fails.
I found the solution here https://github.com/tensorflow/tensorflow/issues/34016
I change the file from hdf5 to tf
hdf5
tf
weights_path = 'weights' if not os.path.exists(weights_path): os.makedirs(weights_path) weights_path += '/unet_weights.tf'#.hdf5'
My current output looks like
Epoch 4/100 42/42 - 142s - loss: 0.1752 - val_loss: 0.2444 INFO:tensorflow:Assets written to: weights/unet_weights.tf/assets Epoch 5/100
Is it a valid approach?
2.1m questions
2.1m answers
60 comments
57.0k users