我使用tensorflow==0.11.0
来保存我的模型。这使用旧格式。我的文件是:
checkpoint_old/
checkpoint
DCGAN.model-9002
DCGAN.model-9002.meta
如何使用tensorflow==1.0.0
阅读模型?检查点的格式已更改。这似乎不起作用:
from tensorflow.core.protobuf import saver_pb2
saver = tf.train.Saver(write_version = saver_pb2.SaverDef.V1)
ckpt = tf.train.get_checkpoint_state('checkpoint_old')
if ckpt and ckpt.model_checkpoint_path:
print ckpt.model_checkpoint_path #checkpoint_old/DCGAN.model-9002
saver.restore(sess, ckpt.model_checkpoint_path)