tensorflow / tensorflow/models
research/slim: mismatch of classes of VGG models and checkpoints
@marksandler2 is already working on this.
Since Jun 19, 2020.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
It seems that there is a mismatch of the number of classes between the VGG models and the corresponding savepoints.
When trying to restore the savepoint using tf.train.Saver I get the following error:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Assign requires shapes of both tensors to match. lhs shape= [1001] rhs shape= [1000]
[[node save/Assign_36 (defined at export_inference_graph.py:161) ]]
Errors may have originated from an input operation.
Input Source operations connected to node save/Assign_36:
vgg_19/fc8/biases
It seems that this problem also exists with VGG16: https://stackoverflow.com/questions/40350539/tfslim-problems-loading-saved-checkpoint-for-vgg16
I downloaded the checkpoint from the pre-trained models given at tensorflow/models/research/slim and the model is loaded the same way as export_inference_graph.py does it.
Expected behaviour would be that I can just load the checkpoint for the model and that the number of classes match.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.