Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fashionpedia: Not able to restore model from given checkpoint #814

Closed
mitraavi opened this issue Jul 29, 2020 · 8 comments
Closed

Fashionpedia: Not able to restore model from given checkpoint #814

mitraavi opened this issue Jul 29, 2020 · 8 comments

Comments

@mitraavi
Copy link

Thanks! for sharing the model training and inference codes, however, model restoration issue still persisting, here is what error I'm getting when I'm just trying to restore model from spinenet-143 ckpt:

CODE used to restore:

saver = tf.train.Saver()
with tf.Session() as sess:
saver.restore(sess, './model_spinenet_143/model.ckpt')

ERROR:

NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
root error(s) found.
(0) Not found: Key Variable not found in checkpoint
[[node save/RestoreV2 (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]

I'm using tensorflow-gpu 1.15.0 version in colab, any hint as this error is occurring ?
Thanks

@mitraavi
Copy link
Author

mitraavi commented Aug 3, 2020

I'm able to run inference now on CPU after selecting the "spinenet config" file in the command line.

@mitraavi
Copy link
Author

mitraavi commented Aug 3, 2020

@richardaecn thanks! for pointing out the config selection issue

@richardaecn
Copy link
Contributor

@mitraavi
Glad to hear that! Please feel free to close the issue.

@mitraavi mitraavi closed this as completed Aug 4, 2020
@mitraavi
Copy link
Author

mitraavi commented Aug 4, 2020

Able to run inferences with suggestions from @richardaecn, hence closing this issue

@gireek
Copy link

gireek commented Sep 4, 2020

@mitraavi Do you please mind sharing the colab where you were able to inference in Colab?

@gireek
Copy link

gireek commented Sep 4, 2020

@richardaecn I get this error when running from the detection folder:

/usr/local/lib/python3.6/dist-packages/absl/flags/_validators.py:359: UserWarning: Flag --model has a non-None default value; therefore, mark_flag_as_required will pass even if flag is not specified in the command line!
  'command line!' % flag_name)
/usr/local/lib/python3.6/dist-packages/absl/flags/_validators.py:359: UserWarning: Flag --checkpoint_path has a non-None default value; therefore, mark_flag_as_required will pass even if flag is not specified in the command line!
  'command line!' % flag_name)
/usr/local/lib/python3.6/dist-packages/absl/flags/_validators.py:359: UserWarning: Flag --label_map_file has a non-None default value; therefore, mark_flag_as_required will pass even if flag is not specified in the command line!
  'command line!' % flag_name)
/usr/local/lib/python3.6/dist-packages/absl/flags/_validators.py:359: UserWarning: Flag --image_file_pattern has a non-None default value; therefore, mark_flag_as_required will pass even if flag is not specified in the command line!
  'command line!' % flag_name)
/usr/local/lib/python3.6/dist-packages/absl/flags/_validators.py:359: UserWarning: Flag --output_html has a non-None default value; therefore, mark_flag_as_required will pass even if flag is not specified in the command line!
  'command line!' % flag_name)
 - Loading the label map...
Traceback (most recent call last):
  File "inference.py", line 221, in <module>
    tf.app.run(main)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250, in _run_main
    sys.exit(main(argv))
  File "inference.py", line 102, in main
    params = config_factory.config_generator(FLAGS.model)
  File "/content/tpu/models/official/detection/configs/factory.py", line 43, in config_generator
    raise ValueError('Model %s is not supported.' % model)
ValueError: Model attribute_mask_rcnn is not supported.

How will it know to call the inference.py in the fashionpedia folder?

@mitraavi
Copy link
Author

mitraavi commented Sep 5, 2020

@gireek i did not run in colab, but i could run it in laptop without error and steps to run i already shared earlier.

@mitraavi
Copy link
Author

mitraavi commented Sep 5, 2020

@gireek further to the running env ...initially i tried to run it in colab, but due to path setting issue i was facing in colab similar to issue you reported earlier i switched to using laptop to run the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants