-
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
Add MNIST dataset & drop torchvision dep. from tests #986
Conversation
Hello @awaelchli! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-03-27 22:46:44 UTC |
why is it trying to run the imagenet example? It's not part of the tests, or is it? |
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.
just curious, do we need all these functions/methods, I would rather use the minimal version so we do not maintain it in future...
Personally I would make simple MNIST datasets and include the to_tensor
in it (__getitem__
) so we do not need any transformers in tests (anyway we do just a few fist epochs)
Also, we can still use torchvision
in examples just adjust tests (split tests and examples, I will do :])
ok, I will try to compress everything. Most of the code is for downloading and extracting the dataset files. I didn't want to remove any tests, that's why I tried to override the imports. Maybe you go ahead and do the splitting of examples and tests first, then I will adjust my changes to that. |
Well I didn't check it in detail...
You are right, we shall not change any test, just swap dataset source lok PS: sorry for miss-click (accidentally closing, working on phone) |
@Borda I made it a lot simpler. It is not necessary to do all the data extraction that torchvision does. The MNIST class is now very simple as you wished. And I got rid of the transforms, so we can even drop the PIL requirement now. No PIL to Tensor conversions needed. Now we just need to decouple the tests from examples :) |
@awaelchli I have prepared the split, check #990 |
@Borda Great! I think yours should be merged first, because I can't make the tests pass otherwise. |
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.
GREAT job! Get this done as soon as possible...
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
The test failed because of this?
|
@bmartinn is there a way we can suppress such messages during test? |
We know about it... allegroai/clearml#119 |
Hi @awaelchli , as @Borda mentioned the issue is known, and a fix was already merged into the master branch. |
@Borda I see KeyBoardInterrupt in CI. Did you have that before? |
not really... |
@williamFalcon @PyTorchLightning/core-contributors lets get this done... |
* added custom mnist without torchvision dep * move files so it does not conflict with mnist gitignore * mock torchvision for tests * fix line too long * fix line too long * fix "module level import not at top of file" warning * move mock imports to __init__.py * simplify MNIST a lot and download directly the .pt files * further simplify and clean up mnist * revert import overrides * make as before * drop PIL requirement * move mnist.py to datasets subfolder * use logging instead of print * choose same name as in torchvision * remove torchvision and pillow also from yml file * refactor if train Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * capitalized class attr * moved mnist to models * re-added datsets ignore * better name for file variable * Update mnist.py * move dataset classes to datasets.py * new line * update * update * fix automerge * move to base folder * adapt testingmnist to new mnist base class * remove temporal fix * fix datatype * remove old testingmnist * readable * fix import * fix whitespace * docstring Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * Update tests/base/datasets.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * changelog * added types * Update CHANGELOG.md Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * exist->isfile Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * index -> idx * temporary fix for trains error * better changelog message Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Before submitting
What does this PR do?
Fixes #942 and follow up to #990.
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 🙃