Skip to content

research/slim: mismatch of classes of VGG models and checkpoints #7151

@twatzl

Description

@twatzl

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.

Metadata

Metadata

Labels

models:researchmodels that come under research directory

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions