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

Add AverageModelCheckpoint #926

Merged
merged 4 commits into from
Jan 28, 2020
Merged

Conversation

Squadrick
Copy link
Member

Closes #903

@wuliytTaotao
Copy link

A question about AverageModelCheckpoint, when saving the moving average weights, we should not change the model.trainable_weights for we may keep training later. Does AverageModelCheckpoint change the model's weights after saving function?

@Squadrick
Copy link
Member Author

A question about AverageModelCheckpoint, when saving the moving average weights, we should not change the model.trainable_weights for we may keep training later. Does AverageModelCheckpoint change the model's weights after saving function?

@wuliytTaotao I'll use a parameter that allows both options:

  1. Assign the moving average weights to the model, and save them.
  2. Keep the old non-averaged weights, but the saved model uses the average weights.

That will cover both scenarios of the user.

wuliytTaotao
wuliytTaotao previously approved these changes Jan 27, 2020
@seanpmorgan
Copy link
Member

@Squadrick Thanks!! LGTM. Would you mind merging master into this. I believe we'll need to add type checking, but want to verify the CI

@Squadrick
Copy link
Member Author

@seanpmorgan Added type info, and it should be good to merge.

Copy link
Member

@seanpmorgan seanpmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks again!

@seanpmorgan seanpmorgan merged commit 0c40e11 into tensorflow:master Jan 28, 2020
@Squadrick Squadrick deleted the moving-avg branch January 28, 2020 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MovingAverage cannot be used with callbacks.ModelCheckpoint
5 participants