Skip to content
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

Error on dataset load if local Python environment is used #39

Open
kolabit opened this issue Aug 19, 2022 · 4 comments
Open

Error on dataset load if local Python environment is used #39

kolabit opened this issue Aug 19, 2022 · 4 comments

Comments

@kolabit
Copy link

kolabit commented Aug 19, 2022

I am getting error on MNIST loading, if local Python environment is used (3.8, in ~/anaconda3 folder):
"NameError: name 'NoneType' is not defined"
During the installation, this environment was validated by TorchStudio installer.
It works OK, if I use Python from ~/TorchStudio/python

Below is the console output:
16:42:47.613 INFO starting TorchStudio 0.9.9 on "Ubuntu 20.04.4 LTS"
16:42:48.222 INFO python check: "Checking Python version...\n\nChecking required packages...\n\nLoading PyTorch...\n\nListing devices...\n\n" "Functional (Linux-5.15.0-46-generic-x86_64-with-glibc2.10, Python 3.8, PyTorch 1.12, Devices: CPU (cpu), NVIDIA GeForce RTX 2060 (cuda:0))\n"
16:42:48.877 INFO checking notifications...
16:42:48.881 INFO inference: "Loading PyTorch...\n\n" ""
16:42:49.392 INFO inference: "Training script connected\n\n" ""
16:42:49.392 INFO inference: "Setting device...\n\n" ""
16:42:49.651 INFO dataset modules scan error: "Error parsing module: File , line 950, in _sanity_check\n\nValueError: Empty module name \n\n"
16:42:49.720 INFO modeltab modules scan error: "Error parsing module: File , line 950, in _sanity_check\n\nValueError: Empty module name \n\n"
16:42:52.649 INFO datasetload: "Loading PyTorch...\n\n" ""
16:42:53.214 INFO datasetload: "Dataset script connected\n\n" ""
16:42:53.215 INFO datasetload: "Loading dataset...\n\n" ""
16:42:53.215 INFO datasetload: "dataset definition, line 27, in MNIST\n\nNameError: name 'NoneType' is not defined\n" ""

@divideconcept
Copy link
Contributor

Could you provide a screenshot of TorchStudio (the entire UI) when the error happens?

@kolabit
Copy link
Author

kolabit commented Aug 20, 2022

Screenshot from 2022-08-20 11-05-52

@divideconcept
Copy link
Contributor

divideconcept commented Aug 20, 2022

Thanks. Can you check "Code" at the top, and copy/paste here the source code that will be displayed ? In particular line 27 of the source code.

@kolabit
Copy link
Author

kolabit commented Sep 2, 2022

In "non-working" version :
def __init__(self, root: str, train: bool = True, transform: typing.Union[typing.Callable, NoneType] = None, target_transform: typing.Union[typing.Callable, NoneType] = None, download: bool = False):

in "working"
def __init__(self, root: str, train: bool = True, transform: typing.Optional[typing.Callable] = None, target_transform: typing.Optional[typing.Callable] = None, download: bool = False):

So, if I remove NoneType from the both places in "non-working" version, it works OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants