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

Incompatability between torch>=2.3 and torchdatasets==0.2.0 #129060

Closed
Zerhigh opened this issue Jun 19, 2024 · 2 comments
Closed

Incompatability between torch>=2.3 and torchdatasets==0.2.0 #129060

Zerhigh opened this issue Jun 19, 2024 · 2 comments
Labels
module: binaries Anything related to official binaries that we release to users module: regression It used to work, and now it doesn't module: windows Windows support for PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@Zerhigh
Copy link

Zerhigh commented Jun 19, 2024

🐛 Describe the bug

When using torch>=2.3 and torchdatasets==0.2.0 in python==3.9 the following error occurs:

ImportError: cannot import name '_typing' from 'torch.utils.data'

Upon further investigation the _typing file is missing in 'torch.utils.data'.

Fixed it myself by including the following _typing.py file in the path '\venv\Lib\site-packages\torch\utils\data'

_typing.zip

Versions

StatusCode : 200
StatusDescription : OK
Content : # mypy: allow-untyped-defs

                # Unlike the rest of the PyTorch this file must be python2 compliant.
                # This script outputs relevant system environment info
                # Run it with `python collect_env.py` or `pytho...

RawContent : HTTP/1.1 200 OK
Connection: keep-alive
Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
Strict-Transport-Security: max-age=31536000
X-Content-Type-Options: nosniff
...
Forms : {}
Headers : {[Connection, keep-alive], [Content-Security-Policy, default-src 'none'; style-src 'unsafe-inline'; sandbox],
[Strict-Transport-Security, max-age=31536000], [X-Content-Type-Options, nosniff]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 23357

Collecting environment information...
PyTorch version: 2.3.1+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Pro
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22631-SP0
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture=9
CurrentClockSpeed=1596
DeviceID=CPU0
Family=205
L2CacheSize=1024
L2CacheSpeed=
Manufacturer=GenuineIntel
MaxClockSpeed=1896
Name=Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz
ProcessorType=3
Revision=

Versions of relevant libraries:
[pip3] numpy==1.24.3
[pip3] torch==2.3.1
[pip3] torchaudio==2.3.0
[pip3] torchdatasets==0.2.0
[pip3] torchvision==0.18.0
[conda] Could not collect

cc @seemethere @malfet @osalpekar @atalman @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht @iremyux @Blackhex @cristianPanaite

@Zerhigh
Copy link
Author

Zerhigh commented Jun 19, 2024

Solution (works locally on my machine..) is already provided in the issue description. Please verify this method and apply it to the codebase

@malfet malfet added module: binaries Anything related to official binaries that we release to users triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: regression It used to work, and now it doesn't module: windows Windows support for PyTorch labels Jun 21, 2024
@malfet
Copy link
Contributor

malfet commented Jun 21, 2024

torchdatasets has not been updated since 2021, and torch.utils.data._typing was removed in torch-1.12.
It looks like if you need to use torchdatasets than it should be used with torch-1.11

Otherwise, you can try to submit a PR against torchdatasets to remove the dependency

@malfet malfet closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: binaries Anything related to official binaries that we release to users module: regression It used to work, and now it doesn't module: windows Windows support for PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants