Open piyushongithub opened 1 year ago
@piyushongithub
Review your model.fit()
code. It is a shape error caused due to not includingModelCheckpoint callback
while refitting model 3(unfroze,fine-tune last 10). I encountered same error and attempted to resolve it by adding Model Checkpoint. I have also provided solution on Udemy as well
@JordanTheDodger But it would start fine-tuning from the stage model_3 was completed not from the stage of feature extractor. We want to fine tune from the stage of feature extractor (model_2 before fine tuning on 10% data).
@piyushongithub I had the same issue. Apparently is because the order of the weights changes when saving the model with modified trainable attributes link.
I fixed it by saving the checkpoint as as h5 and setiing the base_modle layer to not trainable before loading the weights.
I hope this helps.
Hi @piyushongithub,
This seems to be an issue with various versions of TensorFlow and the tf.keras.applications.efficientnet
models.
Please see https://github.com/mrdbourke/tensorflow-deep-learning/issues/544 for some potential fixes (namely installing TensorFlow 2.9.0 which seems to be the most stable version at the time of writing).
I ran the notebook "05_transfer_learning_in_tensorflow_part_2_fine_tuning.ipynb" on google colab but I got an error in "Model 4: Fine-tuning an existing model all of data" section. It seems like tensorflow is unable to load weights from checkpoint for model_2. . I am getting shape incompatible error. I have attached screenshot of the error below.