Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
284 views
in Technique[技术] by (71.8m points)

python - 还原的Tensorflow模型无法正确还原参数(Restored Tensorflow model not restoring parameters correctly)

I have a saved TensorFlow model.

(我已经保存了TensorFlow模型。)

On resuming the model resumes perfectly but then it begins to train like a completely new model rather than restored model.

(在恢复模型后,模型可以完美恢复,但随后就开始像全新模型一样进行训练,而不是恢复模型。)

eg I have a model-38403 file stored which has an accuracy of roughly 85% but on resuming, the global step counter shows 38404 step but then the accuracy is merely 2%.

(例如,我存储了一个Model-38403文件,其准确性大约为85%,但是在继续时,全局步数计数器显示38404步数,但是准确度仅为2%。)

I am doing the following:

(我正在执行以下操作:)

checkpoint_path = './train_dir/rn-model'
with tf.compat.v1.Session() as sess:
    saver = tf.compat.v1.train.Saver(max_to_keep=1)
    saver.restore(sess, tf.compat.v1.train.latest_checkpoint(checkpoint_path))
    # then training continues

Do I need to change something which I might be doing wrongly?

(我是否需要更改可能做错了的事情?)

I already have referred to few questions on the forum as well as looked on the examples of Tensorflow website but it is always the same.

(我已经在论坛上提到了几个问题,并在Tensorflow网站的示例中进行了查看,但它始终是相同的。)

My tensorflow version is 1.14.0.

(我的tensorflow版本是1.14.0。)

  ask by Rishik Mani translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...