0

I need to extract details from saved checkpoint (index & data files) info like:

  • which optimizer algorithm
  • which learning rate ... etc.

how to get this details from python TensorFlow or Linux.

Essam Goda
  • 141
  • 1
  • 3
  • 14

1 Answers1

1

I do not know if all the information you want has been saved in the checkpoints you are referring to (some of them have to be explicitly asked to be stored, see this).

In any case the TF documentation about checkpoints is quite well done.

You can extract information by

reader = tf.train.load_checkpoint('./tf_ckpts/')
shape_from_key = reader.get_variable_to_shape_map()
dtype_from_key = reader.get_variable_to_dtype_map()

sorted(shape_from_key.keys())

and get the dictionaries keys to look at, e.g.

key = 'optimizer/learning_rate/.ATTRIBUTES/VARIABLE_VALUE'

print("Shape:", shape_from_key[key])
print("Dtype:", dtype_from_key[key].name)
Oscar
  • 460
  • 3
  • 18