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

recommended torch version may be wrong #22

Open
RylonW opened this issue Aug 22, 2022 · 2 comments
Open

recommended torch version may be wrong #22

RylonW opened this issue Aug 22, 2022 · 2 comments

Comments

@RylonW
Copy link

RylonW commented Aug 22, 2022

After installing torch 1.7.1, I got an ERROR:
ModuleNotFoundError: No module named 'torch.fx
What I find on stackoverflow is that torch.fx was added in PyTorch 1.8.0., so may be recommended version is wrong?

@Mingbo-Lee
Copy link

I agree with you.
when I run following command:

python -m pip install -r requirements.txt --user -q
bash run.sh  -t train --cfg experiments/imagenet/cvt/cvt-13-224x224.yaml

I got error:

Traceback (most recent call last):
  File "tools/train.py", line 28, in <module>
    from utils.utils import create_logger
  File "/home/limingbo/project/CvT/tools/../lib/utils/utils.py", line 18, in <module>
    from ptflops import get_model_complexity_info
  File "/home/limingbo/.local/lib/python3.7/site-packages/ptflops/__init__.py", line 10, in <module>
    from .flops_counter import FLOPS_BACKEND, get_model_complexity_info
  File "/home/limingbo/.local/lib/python3.7/site-packages/ptflops/flops_counter.py", line 15, in <module>
    from .aten_engine import get_flops_aten
  File "/home/limingbo/.local/lib/python3.7/site-packages/ptflops/aten_engine.py", line 17, in <module>
    from torch.utils._python_dispatch import TorchDispatchMode
ModuleNotFoundError: No module named 'torch.utils._python_dispatch'

@Mingbo-Lee
Copy link

I agree with you. when I run following command:

python -m pip install -r requirements.txt --user -q
bash run.sh -t train --cfg experiments/imagenet/cvt/cvt-13-224x224.yaml
I got error:

Traceback (most recent call last):
File "tools/train.py", line 28, in
from utils.utils import create_logger
File "/home/limingbo/project/CvT/tools/../lib/utils/utils.py", line 18, in
from ptflops import get_model_complexity_info
File "/home/limingbo/.local/lib/python3.7/site-packages/ptflops/init.py", line 10, in
from .flops_counter import FLOPS_BACKEND, get_model_complexity_info
File "/home/limingbo/.local/lib/python3.7/site-packages/ptflops/flops_counter.py", line 15, in
from .aten_engine import get_flops_aten
File "/home/limingbo/.local/lib/python3.7/site-packages/ptflops/aten_engine.py", line 17, in
from torch.utils._python_dispatch import TorchDispatchMode
ModuleNotFoundError: No module named 'torch.utils._python_dispatch'

In fact, this problem can be solved with the following command:

pip install ptflops==0.7.2.2

Ref to https://blog.csdn.net/qq_43298381/article/details/143062160

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