Load pretrain checkpoint in tf2 version
Please provide the entire URL of the model you are using?
Describe the feature you request and the current behavior/state. Hello, I have noticed that in official detection model the checkpoint_utils.py show me how to load tf1 backone checkpoint to retinanet but I want to know how I can load tf2 restnet backbone to retinanet which doesn't save with name scope. I will very appreciation if I get you help. Thank you very much! Are you willing to contribute it (Yes/No)? No Any other info.
Thank you! Assigned to owners. This is a long-lasting issue. I hope the team can get to work on it.
In general, you can comment out the checkpoint_utils call. tf.train.Checkpoint or keras.Model.load_weights can restore you TF2 checkpoints. I am just curious where do you obtain TF2 resnet backbone checkpoint. Is it of the image_classification project?
In general, you can comment out the checkpoint_utils call. tf.train.Checkpoint or keras.Model.load_weights can restore you TF2 checkpoints. I am just curious where do you obtain TF2 resnet backbone checkpoint. Is it of the image_classification project?
Yes, I just replace the resnet arthitecture with image_classification prroject, but I can't load the pretrain checkpoint because the tf2 checkpoint don't save with scope name, the tf2 checkpoint variables like this , ( model/layer_with_weights-0/kernel/.ATTRIBUTES/VARIABLE_VALUE', [3, 3, 3, 32]), ('model/layer_with_weights-0/kernel/.OPTIMIZER_SLOT/optimizer/momentum/.ATTRIBUTES/VARIABLE_VALUE', [3, 3, 3, 32]), ('model/layer_with_weights-0/kernel/.OPTIMIZER_SLOT/optimizer/rms/.ATTRIBUTES/VARIABLE_VALUE', [3, 3, 3, 32]), ('model/layer_with_weights-1/beta/.ATTRIBUTES/VARIABLE_VALUE', [32]), ('model/layer_with_weights-1/beta/.OPTIMIZER_SLOT/optimizer/momentum/.ATTRIBUTES/VARIABLE_VALUE', [32]), ('model/layer_with_weights-1/beta/.OPTIMIZER_SLOT/optimizer/rms/.ATTRIBUTES/VARIABLE_VALUE', [32]), ('model/layer_with_weights-1/gamma/.ATTRIBUTES/VARIABLE_VALUE', [32]), ('model/layer_with_weights-1/gamma/.OPTIMIZER_SLOT/optimizer/momentum/.ATTRIBUTES/VARIABLE_VALUE', [32]), ('model/layer_with_weights-1/gamma/.OPTIMIZER_SLOT/optimizer/rms/.ATTRIBUTES/VARIABLE_VALUE', [32]) ...... so I am confused about which layers will be load. Can you give me a official example? Thank you very much!
Hi @weichen456, the backbone resnet implementation does not match image classification resnet model, due to legacy issue. I will assign the issue to the internal team.
We are working on it with the compatible ResNet implementation.
Hi @weichen456,
Now all Pretrain checkpoints can be loaded in tf2 version and you can find the list of pretrain checkpoints to be loaded in tf2 version.Thanks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.