简体   繁体   English

Tensorflow:如何恢复训练模型? (蟒蛇)

[英]Tensorflow: How can I restore model for training? (Python)

I want to train a cnn for 20000 steps. 我想训练20000个步骤的cnn。 In the 100th step I want to save all variables and after that I want to re-run my code restoring model and starting from the 100th step. 在第100步中,我想保存所有变量,然后再从第100步开始,重新运行我的代码恢复模型。 I am trying to make it work with tensorflow documentation: https://www.tensorflow.org/versions/r0.10/how_tos/variables/index.html but I can't. 我正在尝试使其与tensorflow文档一起使用: https ://www.tensorflow.org/versions/r0.10/how_tos/variables/index.html但我不能。 Any help? 有什么帮助吗?

Im stuck in something similar but maybe this link can help you. 我陷入了类似的困境,但也许此链接可以为您提供帮助。 Im new in tensorflow but i think you cant restore and fit without need to training again you model. 我是tensorflow的新手,但我认为您无法恢复和适应而不需要再次训练您的模型。

此功能仍然不稳定,并且文档已经过时,因此令人困惑,对我有用的(这是来自google的直接在tensorflow上工作的人的建议)是在训练之前在模型的构造函数上使用model_dir参数这将告诉您存储模型的位置,在训练之后,您只需使用相同的model_dir再次实例化模型,它将从生成的文件和检查点中恢复模型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM