models icon indicating copy to clipboard operation
models copied to clipboard

How to load save model (.ckpt file) from Index file, Meta file and DATA file? there is no file having .ckpt extension. I am running one code where .ckpt file is required.

Open RonakPandya072 opened this issue 3 years ago • 2 comments

RonakPandya072 avatar Feb 14 '23 07:02 RonakPandya072

Hi @RonakPandya072,

Please make sure to follow the template which is present while opening the new issue, this will helps us to resolve the issue faster and understand it more clearly, hope this helps you.

Checkpoints stored will have following file formats:

  1. *.ckpt.meta
  2. *.ckpt.index
  3. *.ckpt.data-*

To load the checkpoints you can use the following commands

# This step is useful when you have multiple checkpoints and to take latest checkpoint
checkpoint_path = tf.train.latest_checkpoint(checkpoint_dir) # checkpoint_dir is where above files are present
checkpoint = tf.train.Checkpoint(model=model) # model which has already been constructed
status = checkpoint.restore(checkpoint_path)  # restore the weights from checkpoint

Thanks.

laxmareddyp avatar Feb 14 '23 18:02 laxmareddyp

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.

google-ml-butler[bot] avatar Feb 21 '23 19:02 google-ml-butler[bot]

To my knowledge you should have files on the format: model.ckpt.index, model.ckpt.meta, model.ckpt.data or similar

You should be able to load load the path "model.ckpt"

voxlz avatar Feb 28 '23 15:02 voxlz

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.

google-ml-butler[bot] avatar Mar 09 '23 00:03 google-ml-butler[bot]

Closing as stale. Please reopen if you'd like to work on this further. Thanks

laxmareddyp avatar Mar 13 '23 17:03 laxmareddyp

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Mar 13 '23 17:03 google-ml-butler[bot]