-
Notifications
You must be signed in to change notification settings - Fork 323
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
Refactor pl_bolts.datamodules
and pl_bolts.datasets
#338
Refactor pl_bolts.datamodules
and pl_bolts.datasets
#338
Conversation
Hello @akihironitta! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-12-14 08:10:05 UTC |
Codecov Report
@@ Coverage Diff @@
## master #338 +/- ##
==========================================
- Coverage 81.09% 80.77% -0.32%
==========================================
Files 100 101 +1
Lines 5722 5706 -16
==========================================
- Hits 4640 4609 -31
- Misses 1082 1097 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Do we want to keep noisy warnings here...
python -c "import pl_bolts"
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/models/mnist_module.py:14: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/callbacks/variational.py:10: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/callbacks/vision/image_generation.py:9: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/binary_mnist_datamodule.py:12: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datasets/cifar10_dataset.py:13: UserWarning: You want to use `Pillow` which is not installed yet, install it with `pip install Pillow`.
warn('You want to use `Pillow` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/transforms/dataset_normalizations.py:5: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/cifar10_datamodule.py:17: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/fashion_mnist_datamodule.py:11: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/imagenet_datamodule.py:13: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/imagenet_datamodule.py:22: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/mnist_datamodule.py:11: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/stl10_datamodule.py:16: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover
/home/nitta/Dropbox/home/src/projects/pytorch-lightning-bolts/pl_bolts/datamodules/cityscapes_datamodule.py:11: UserWarning: You want to use `torchvision` which is not installed yet, install it with `pip install torchvision`.
warn('You want to use `torchvision` which is not installed yet,' # pragma: no-cover |
@akihironitta I think we can add global var to the package which would "count" if the user already warned about the one error... >> warn user just one per load/usage Bolts Alternatively, add a custom warning function which would keep the count inside
lets see #341 |
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.
Please look at some of the comments left :)
@Borda @annikabrundyn Once this PR is merged, I'll quickly submit PRs to update |
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.
nice, I will update #448 accordingly...
42a383e
to
fc579ea
Compare
* Remove try: ... except: ... * Fix experience_source * Fix imagenet * Fix kitti * Fix sklearn * Fix vocdetection * Fix typo * Remove duplicate * Fix by flake8 * Add optional packages availability vars * binary_mnist * Use pl_bolts._SKLEARN_AVAILABLE * Apply isort * cifar10 * mnist * cityscapes * fashion mnist * ssl_imagenet * stl10 * cifar10 * dummy * fix city * fix stl10 * fix mnist * ssl_amdim * remove unused DataLoader and fix docs * use from ... import ... * fix pragma: no cover * Fix forward reference in annotations * binmnist * Same order as imports * Move vars from __init__ to utils/__init__ * Remove vars from __init__ * Update vars * Apply isort
pl_bolts.datamodules
and pl_bolts.datasets
* Add DCGAN module * Undo black on conf.py * Add tests for DCGAN * Fix flake8 and codefactor * Add types and small refactoring * Make image sampler callback work * Upgrade DQN to use .log (#404) * Upgrade DQN to use .log * remove unused * pep8 * fixed other dqn * fix loss test case for batch size variation (#402) * Decouple DataModules from Models - CPCV2 (#386) * Decouple dms from CPCV2 * Update tests * Add docstrings, fix import, and update changelog * Update transforms * bugfix: batch_size parameter for DataModules remaining (#344) * bugfix: batch_size for DataModules remaining * Update sklearn datamodule tests * Fix default_transforms. Keep internal for every data module * fix typo on binary_mnist_datamodule thanks @akihironitta Co-authored-by: Akihiro Nitta <nitta@akihironitta.com> Co-authored-by: Akihiro Nitta <nitta@akihironitta.com> * Fix a typo/copy paste error (#415) * Just a Typo (#413) missing a ' at the end of dataset='stl10 * Remove unused arguments (#418) * tests: Use cached datasets in LitMNIST and the doctests (#414) * Use cached datasets * Use cached datasets in doctests * clear replay buffer after trajectory (#425) * stale: update label * bugfix: Add missing imports to pl_bolts/__init__.py (#430) * Add missing imports * Add missing imports * Apply isort * Fix CIFAR num_samples (#432) * Add static type checker mypy to the tests and pre-commit hooks (#433) * Add mypy check to GitHub Actions * Run mypy on pl_bolts only * Add mypy check to pre-commit * Add an empty line at the end of files * Update mypy config * Update mypy config * Update mypy config * show Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * missing logo * Add type annotations to pl_bolts/__init__.py (#435) * Run mypy on pl_bolts only * Update mypy config * Add type hints to pl_bolts/__init__.py * mypy Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz> * skip hanging (#437) * Option to normalize latent interpolation images (#438) * add option to normalize latent interpolation images * linspace * update Co-authored-by: ananyahjha93 <ananya@pytorchlightning.ai> * 0.2.6rc1 * Warnings fix (#449) * Revert "Merge pull request #1 from ganprad/warnings_fix" This reverts commit 7c5aaf0. * Fixes warning related np.integer in SklearnDataModule Fixes this warning: ```DeprecationWarning: Converting `np.integer` or `np.signedinteger` to a dtype is deprecated. The current result is `np.dtype(np.int_)` which is not strictly correct. Note that the result depends on the system. To ensure stable results use may want to use `np.int64` or `np.int32```` * Refactor datamodules/datasets (#338) * Remove try: ... except: ... * Fix experience_source * Fix imagenet * Fix kitti * Fix sklearn * Fix vocdetection * Fix typo * Remove duplicate * Fix by flake8 * Add optional packages availability vars * binary_mnist * Use pl_bolts._SKLEARN_AVAILABLE * Apply isort * cifar10 * mnist * cityscapes * fashion mnist * ssl_imagenet * stl10 * cifar10 * dummy * fix city * fix stl10 * fix mnist * ssl_amdim * remove unused DataLoader and fix docs * use from ... import ... * fix pragma: no cover * Fix forward reference in annotations * binmnist * Same order as imports * Move vars from __init__ to utils/__init__ * Remove vars from __init__ * Update vars * Apply isort * update min requirements - PL 1.1.1 (#448) * update min requirements * rc0 * imports * isort * flake8 * 1.1.1 * flake8 * docs * Add missing optional packages to `requirements/*.txt` (#450) * Import matplotlib at the top * Add missing optional packages * Update wandb * Add mypy to requirements * update Isort (#457) * Adding flags to datamodules (#388) * Adding flags to datamodules * Finishing up changes * Fixing syntax error * More syntax errors * More * Adding drop_last flag to sklearn test * Adding drop_last flag to sklearn test * Updating doc for reflect drop_last=False * Adding flags to datamodules * Finishing up changes * Fixing syntax error * More syntax errors * More * Adding drop_last flag to sklearn test * Adding drop_last flag to sklearn test * Updating doc for reflect drop_last=False * Cleaning up parameters and docstring * Fixing syntax error * Fixing documentation * Hardcoding shuffle=False for val and test * Add DCGAN module * Small fixes * Remove DataModules * Update docs * Update docs * Update torchvision import * Import gym as optional package to build docs successfully (#458) * Import gym as optional package * Fix import * Apply isort * bugfix: batch_size parameter for DataModules remaining (#344) * bugfix: batch_size for DataModules remaining * Update sklearn datamodule tests * Fix default_transforms. Keep internal for every data module * fix typo on binary_mnist_datamodule thanks @akihironitta Co-authored-by: Akihiro Nitta <nitta@akihironitta.com> Co-authored-by: Akihiro Nitta <nitta@akihironitta.com> * Option to normalize latent interpolation images (#438) * add option to normalize latent interpolation images * linspace * update Co-authored-by: ananyahjha93 <ananya@pytorchlightning.ai> * update min requirements - PL 1.1.1 (#448) * update min requirements * rc0 * imports * isort * flake8 * 1.1.1 * flake8 * docs * Apply suggestions from code review * Apply suggestions from code review * Add docs * Use LSUN instead of CIFAR10 * Update TensorboardGenerativeModelImageSampler * Update docs with lsun * Update test * Revert TensorboardGenerativeModelImageSampler changes * Remove ModelCheckpoint callback and nrow=5 arg * Apply suggestions from code review * Fix test_dcgan * Apply yapf * Apply suggestions from code review Co-authored-by: Teddy Koker <teddy.koker@gmail.com> Co-authored-by: Sidhant Sundrani <sidhant96@outlook.com> Co-authored-by: Akihiro Nitta <nitta@akihironitta.com> Co-authored-by: Héctor Laria <hector_laria@hotmail.com> Co-authored-by: Bartol Karuza <bartol.k@gmail.com> Co-authored-by: Happy Sugar Life <777Jonathansum@gmail.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz> Co-authored-by: ananyahjha93 <ananya@pytorchlightning.ai> Co-authored-by: Pradeep Ganesan <ganprad@users.noreply.github.com> Co-authored-by: Brian Ko <briankosw@gmail.com> Co-authored-by: Christoph Clement <christoph.clement@artorg.unibe.ch>
What does this PR do?
Fixes #337.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃