-
Notifications
You must be signed in to change notification settings - Fork 388
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 unpickling issues with CUDA sub-attributes #431
Conversation
Solves issues with, for example, * `criterion__weight = <cuda tensor>` * `optimizer__state` * `module__some_weird_parameter = <cuda_tensor>` Before `criterion` was never considered a CUDA dependent attribute, this is also fixed.
I think there was also a bug where |
LGTM. Could you quickly comment on why that part is no longer required: https://github.com/dnouri/skorch/blob/master/skorch/net.py#L1422 (or was it ever?) |
I don't think it was ever needed. Stumbled upon it a while ago and used this occasion to get rid of it. There's one problem though, what do we do about old pickled files? These will fail to load with this change since they are missing the |
This is going to be deprecated with the next non-bugfix release.
I've added a compatibility check so that we can direct users to this version of skorch if they have problems loading their old pickle files. In future versions this fallback can be removed. |
This looks good, just one minor thing: Could you mention in the CHANGES.md that the old pickle format is deprecated and users should re-pickle? |
@BenjaminBossan done, please review again! |
Solves issues with, for example,
criterion__weight = <cuda tensor>
optimizer__state
module__some_weird_parameter = <cuda_tensor>
Before,
criterion
was never considered a CUDA dependentattribute which is also fixed.