-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Split callbacks #849
Split callbacks #849
Conversation
7f09ddd
to
2401027
Compare
Hello @hadim! Thanks for updating this PR.
Comment last updated at 2020-02-22 13:39:46 UTC |
Not sure about the failing CI jobs... |
@jeremyjordan I would increase the |
fe47a9c
to
23470f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this separation, just a few recommendations :]
4dd0f91
to
9499527
Compare
CIs are great but I never got spammed like that for a simple PR (not by reviewers by but CI services)! |
@hadim the Typo bot is off (wrong choice) or which CI borders you? =) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PyTorchLightning/core-contributors does anyone have any idea how to avoid duplicating package versions if this adds conda
environment config?
checkpoint_callback = ModelCheckpoint(filepath='my_path') | ||
Trainer(checkpoint_callback=checkpoint_callback) | ||
|
||
# saves checkpoints to my_path whenever 'val_loss' has a new min |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, having this comment above creating a saving callback would be better :]
240df7f
to
9bbf29c
Compare
Ready to merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 just as it is a large change I would like else from @PyTorchLightning/core-contributors to approve it...
@hadim GREAT job! pls, add this change to CHANGELOG...
Careful when you commit. flake8 failed... I'll fix it. |
yeah I was about to fix it, this is the drawback while editing in a browser (the only way how to touch the PR so far I know...) |
@Borda I also fixed the formatting issues on CHANGELOG. |
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
980a0d1
to
6b61f43
Compare
Awesome PR! Mind fixing the GPU tests? :)
|
I can't easily run the test on multi GPUs. Looking a the traceback the error seems related to multiprocessing and pickle on @Borda any idea? |
Lambda functions can't be pickled. Distributed stuff needs to pickle the objects to move them on to the right machines. The solution here would be to remove the lambda function in the init of the ModelCheckpoint class, i.e. this line:
should be removed. Hope that helps! |
Done. Thanks @ethanwharris . |
Removing the lambda function model_checkpoint. Look at 2244f8c Note that I haven't tested it since I don't have easy access to a ddp machine. |
* add .vscode in .gitignore * Split callbacks in individual files + add a property to Callback for easy trainer instance access * formatting * Add a conda env file for quick and easy env setup to develop on PL * Adress comments * add fix to kth_best_model * add some typing to callbacks * fix typo * add autopep8 config to pyproject.toml * format again * format * fix toml * fix toml again * consistent max line length in all config files * remove conda env file * Update pytorch_lightning/callbacks/early_stopping.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * Update pytorch_lightning/callbacks/model_checkpoint.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * docstring * Update pytorch_lightning/callbacks/model_checkpoint.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * Update pytorch_lightning/callbacks/model_checkpoint.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * fix logic error * format * simplify if/else * format * fix linting issue in changelog * edit changelog about new callback mechanism * fix remaining formating issue on CHANGELOG * remove lambda function because it's compatible with pickle (used during ddp) Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Following #776.
All callbacks are split into individual files. Small files are easier to read. It also makes tracking history changes easier.