Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Adam saving #8804

Merged
merged 1 commit into from
Dec 15, 2017
Merged

Fix Adam saving #8804

merged 1 commit into from
Dec 15, 2017

Conversation

yuyang-huang
Copy link
Contributor

Fix a bug in model saving caused by PR #8693.

K.batch_get_value does not support None values. An error occurs when it is called in save_model to get Adam(amsgrad=False) optimizer weights (on all 3 backends).

Fix it by creating size-1 zero tensors instead of None. Cannot use size-0 tensors because K.batch_set_value would fail on size-0 tensors during model loading.

Also changed a test in test_model_saving.py (switching from RMSprop to Adam) to cover this case.

@fchollet fchollet merged commit e39f6ed into keras-team:master Dec 15, 2017
@yuyang-huang yuyang-huang deleted the fix-adam-saving branch December 16, 2017 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants