-
Notifications
You must be signed in to change notification settings - Fork 26.3k
added state_dict/load_state_dict for ReduceLROnPlateau #7201
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
Conversation
|
Thanks @kahne. Is there a test we can add for this? |
|
@ezyang I tested it manually with |
| self.is_better = partial(self._cmp, mode, threshold_mode, threshold) | ||
|
|
||
| def state_dict(self): | ||
| return {key: value for key, value in self.__dict__.items() if key not in {'optimizer', 'is_better'}} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@kahne there are a few tests in |
|
@pytorchbot retest this please |
|
Thanks @kahne! |
|
Hi! I'm trying to use state_dict() on ReduceLROnPlateau but I got this error: I'm using pytorch 0.4.0. Thanks! |
|
@ignaciorlando Hi! This feature is available in 0.4.1 but not 0.4.0. Can you upgrade to 0.4.1 and try again? |
There is a merged PR #5300 trying to make ReduceLROnPlateau serializable and resolve issue #5218. However, it's still not working. Moreover, it's more consistent to provide the common state_dict/load_state_dict interface for serialization.