Checkpoint Save and Load when using pretrained model

Hello everyone,

I am trying to fine-tune an existing pre-trained model for using ssd_object detection. I am taking inspiration from this notebook: models/research/object_detection/colab_tutorials/eager_few_shot_od_training_tf2_colab.ipynb at master · tensorflow/models · GitHub

I am capable of saving my model after training, I get three files: checkpoint, ckpt-1.data-00000-of-00001 and ckpt-1.index

The model creation function procedure is:

Then I fine-tune the model and save it:
image

Assuming that I am doing things correctly when I want to re-initiate the model and load weights for inference, I am getting very bad results. Just like it’s not trained.

Restore weights function:

Can someone please help me find the problem?

Hi @Ammar_Mohanna ,

If you are working on a pre-trained model with your custom data to fine tune the model, you are seeing bad results after loading the model. It’s because of a lack of training data size , learning rate, and other hyperparameters while fine tuning the model.

The model might be overfitting. Try increasing or adjusting the learning rate and adding image augmentation.We need to try different techniques get the best checkpoint before saving and loading the model for predictions.

For reference, you can check this tutorial from official model garden

Thanks.