本文主要是介绍TensorFlow 如何在上次模型训练结果之上继续训练,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在摸索了一段时间后,发现其实很简单。找到之前训练结果输出的checkpoint文件,是一个文本文件,里面记录这你最近输出的模型路径,如下所示
model_checkpoint_path: "/output/ckpt/model.ckpt-20610"
all_model_checkpoint_paths: "/output/ckpt/model.ckpt-20073"
all_model_checkpoint_paths: "/output/ckpt/model.ckpt-20357"
all_model_checkpoint_paths: "/output/ckpt/model.ckpt-20610"
说明你最近一次的模型为 "/output/ckpt/model.ckpt-20610" , 将你模型训练中的checkpoint_path 参数值修改为当前模型路径,然后重新执行模型训练,就会接着当前模型继续训练。
INFO:tensorflow:Recording summary at step 20610. INFO:tensorflow:global step 20620: loss = 3.3006 (2.125 sec/step) INFO:tensorflow:global step 20630: loss = 3.6536 (2.096 sec/step) INFO:tensorflow:global step 20640: loss = 3.4894 (2.086 sec/step) INFO:tensorflow:global step 20650: loss = 4.0706 (2.131 sec/step) INFO:tensorflow:global step 20660: loss = 3.6693 (2.112 sec/step) INFO:tensorflow:global step 20670: loss = 3.8816 (2.146 sec/step) ……
这篇关于TensorFlow 如何在上次模型训练结果之上继续训练的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!