<blockquote>
<p>I'm wondering what's the right approach to resume training using Adam optimizer?</p>
</blockquote>
<p>如前所述:<a href="https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model" rel="nofollow noreferrer">https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model</a>,<code>model.save()</code>后跟{<cd2>}将负责使用保存的训练配置编译模型。在</p>
<pre><code>if not os.path.exists('tf_keras_cifar10.h5'):
model = get_model() #this method constructs the model and compiles it
else:
model = load_model('tf_keras_cifar10.h5') #load the model from file
print('lr is ', K.get_session().run(model.optimizer.lr))
initial_epoch=10
epochs=13
history = model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs,validation_data=(x_test, y_test), initial_epoch=initial_epoch)
model.save('tf_keras_cifar10.h5')
</code></pre>
<ul>
<li>在保存模型之前的初始运行结束时</li>
</ul>
<p>纪元10/10
损失=0.785美元=0.885美元=0美元</p>
<ul>
<li>从保存的模型恢复:</li>
</ul>
<p>纪元11/13
50000/50000[===============================]-15s 293us/样品-损耗:0.6438-acc:0.7777-val_损耗:0.8732-val峈acc:0.7083</p>
<p>请检查此问题以及与使用Adam优化器恢复培训相关的问题(特斯拉斯):{a2}</p>
<p>建议升级TF版本。在</p>