【发布时间】:2019-06-11 14:26:39
【问题描述】:
我训练模型,称为模型 A。然后,我更改优化器并通过模型 A 的检查点初始化模型。但是发生了错误。 因为要保存新模型的所有变量,所以没有使用import_meta_graph('**.ckpt'),也没有在tf.train.Saver()中设置变量。 我该如何解决这个问题?
saver = tf.train.Saver(max_to_keep=args.num_snapshot)
saver.restore(sess, tf.train.get_checkpoint_state(path).model_checkpoint_path)
有错误日志:
NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Key OptimizeLoss/fully_connected_11/biases/Adam not found in checkpoint
[[node save/RestoreV2 (defined at ***.py:130) ]]
【问题讨论】:
标签: python-3.x tensorflow