How do I find the variable names and values that are saved in a checkpoint?

后端 未结 5 503
执笔经年
执笔经年 2020-12-12 18:26

I want to see the variables that are saved in a TensorFlow checkpoint along with their values. How can I find the variable names that are saved in a TensorFlow checkpoint?

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-12 18:51

    A few more details.

    If your model is saved using V2 format, for example, if we have the following files in the directory /my/dir/

    model-10000.data-00000-of-00001
    model-10000.index
    model-10000.meta
    

    then the file_name parameter should only be the prefix, that is

    print_tensors_in_checkpoint_file(file_name='/my/dir/model_10000', tensor_name='', all_tensors=True)
    

    See https://github.com/tensorflow/tensorflow/issues/7696 for a discussion.

提交回复
热议问题