Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes two issues that arised with Pytorch Lightning >= 1.6.0
current_epoch
is now "fixed" in PTL, so we have to make our own fix dynamic and check at runtime the version we are runningtorch.save()
only did not save the state of the PTL trainer correctly. So we revert to saving the PTL module directly using PTL checkpointing mechanism. Pros: it fixes the issue, and also will be more robust because not dependent e.g. on the current path. Con: It saves 2 files instead of one, and the parameters are saved twice. (I'll open a separate issue to address this if we can).