Allen
Allen

Reputation: 149

Variables to save should be passed in a dict or a list

Having trained data for the first time and yes it is a beginners question i still don't know how to retrieve my values .

checkpoint                             model.ckpt-708.index
events.out.tfevents.151971.name        model.ckpt-708.meta
model.ckpt-506.data-00000-of-00001     model.ckpt-809.data-00000-of-00001
model.ckpt-506.index                   model.ckpt-809.index
model.ckpt-506.meta                    model.ckpt-809.meta
model.ckpt-607.data-00000-of-00001     model.ckpt-910.data-00000-of-00001
model.ckpt-607.index                   model.ckpt-910.index
model.ckpt-607.meta                    model.ckpt-910.meta
model.ckpt-708.data-00000-of-00001

This is the output of

ls path_to_directory

then i manually tried opening these files but they wouldn't open so wondering how can i get my data and numbers.

Edit : What i have tried referring to the docs https://www.tensorflow.org/programmers_guide/saved_model

with tf.Session() as sess:
  # Restore variables from disk.
  saver = tf.train.Saver('/tmp/folder/model.ckpt-2425.meta')
  saver.restore(sess, "/tmp/model.ckpt")
  print("Model restored.")

and getting this error TypeError: Variables to save should be passed in a dict or a list

Upvotes: 0

Views: 783

Answers (1)

Superjeka
Superjeka

Reputation: 31

This is a way restore variables in your case: https://www.tensorflow.org/api_docs/python/tf/train/import_meta_graph

with tf.Session() as sess:
  # Restore variables from disk.
  saver = tf.train.import_meta_graph('/tmp/folder/model.ckpt-2425.meta')
  saver.restore(sess, "/tmp/model.ckpt")
  print("Model restored.")

Upvotes: 1

Related Questions