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

ImportError: cannot import name 'TorchDispatchMode' from 'torch.utils._python_dispatch' #24

Open
XU-GITHUB-curry opened this issue Jun 6, 2024 · 1 comment

Comments

@XU-GITHUB-curry
Copy link

Thank you for your sharing! when I followed the instruction to try this project and evalution on ImageNet -1k, It showed this error: ImportError: cannot import name 'TorchDispatchMode' from 'torch.utils._python_dispatch', My conda list is as below:

Name Version Build Channel

_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
ca-certificates 2024.3.11 h06a4308_0
ld_impl_linux-64 2.38 h1181459_1
libffi 3.4.4 h6a678d5_1
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
ncurses 6.4 h6a678d5_0
numpy 1.24.1 pypi_0 pypi
opencv-python 4.4.0.46 pypi_0 pypi
openssl 3.0.13 h7f8727e_2
pillow 10.2.0 pypi_0 pypi
pip 24.0 py38h06a4308_0
ptflops 0.7.3 pypi_0 pypi
python 3.8.19 h955ad1f_0
pyyaml 6.0.1 pypi_0 pypi
readline 8.2 h5eee18b_0
scipy 1.10.1 pypi_0 pypi
setuptools 69.5.1 py38h06a4308_0
sqlite 3.45.3 h5eee18b_0
termcolor 1.1.0 pypi_0 pypi
thop 0.1.1-2209072238 pypi_0 pypi
timm 0.4.12 pypi_0 pypi
tk 8.6.14 h39e8969_0
torch 1.10.0+cu113 pypi_0 pypi
torchaudio 0.10.0+cu113 pypi_0 pypi
torchvision 0.11.1+cu113 pypi_0 pypi
typing-extensions 4.9.0 pypi_0 pypi
wheel 0.43.0 py38h06a4308_0
xz 5.4.6 h5eee18b_1
yacs 0.1.8 pypi_0 pypi
zlib 1.2.13 h5eee18b_1

@pilotztb
Copy link

hi, i find you can solve this problem by upgrading torch versin, for example, i upgrade with pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116

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