小编Tay*_*ers的帖子

如何在Tensorflow r12中通过文件名恢复模型?

我已经运行了分布式mnist示例:https: //github.com/tensorflow/tensorflow/blob/r0.12/tensorflow/tools/dist_test/python/mnist_replica.py

虽然我已经设定了

saver = tf.train.Saver(max_to_keep=0)

在之前的版本中,如r11,我能够遍历每个检查点模型并评估模型的精度.这给了我一个精确度与全局步骤(或迭代)进度的图表.

在r12之前,tensorflow检查点模型保存在两个文件中,model.ckpt-1234并且model-ckpt-1234.meta.可以通过传递model.ckpt-1234文件名来恢复模型saver.restore(sess,'model.ckpt-1234').

然而,我注意到,在R12中,现在有三个输出文件model.ckpt-1234.data-00000-of-000001,model.ckpt-1234.indexmodel.ckpt-1234.meta.

我看到恢复文档说/train/path/model.ckpt应该给出一个路径来恢复而不是文件名.有没有办法一次加载一个检查点文件来评估它?我试图传递model.ckpt-1234.data-00000-of-000001,model.ckpt-1234.indexmodel.ckpt-1234.meta文件,但得到这样的错误如下:

W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open logdir/2016-12-08-13-54/model.ckpt-0.data-00000-of-00001: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?

NotFoundError (see above for traceback): Tensor name "hid_b" not found in checkpoint files logdir/2016-12-08-13-54/model.ckpt-0.index …

tensorflow

12
推荐指数
3
解决办法
2万
查看次数

标签 统计

tensorflow ×1