restore_best_weights issue keras early stopping

两盒软妹~` 提交于 2020-07-08 05:25:06

问题


I am using EarlyStopping from Keras for my deep learning project. The documentations here mentions a very useful idea of restoring best weights. But somehow I am not able to use it yet. I am using Keras 2.2.2/TF 1.10, installed using Anaconda. Call is simple as follows. is there any issue?

es = EarlyStopping(monitor='val_acc', min_delta=1e-4, patience=patience_,verbose=1,restore_best_weights=True)

__init__() got an unexpected keyword argument 'restore_best_weights'


回答1:


Ah, a very common problem. The keras documentation online is produced from the master branch in github, so features that have been introduced only recently are present there, but not yet in any Keras release.

So the restore_best_weights option of the EarlyStopping callback was added on August 18, 2018, while currently the latest Keras release (2.2.2) was made on July 28, 2018. So you will have to use Keras master, wait for a Keras release, or just not use the option.

Update: It is now included in Keras 2.2.3 release.



来源:https://stackoverflow.com/questions/52466932/restore-best-weights-issue-keras-early-stopping

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!