使用pytorchvideo的main最新代码 torch1.8,error:-->module 'torch' has no attribute 'fx'
liuyang77886 opened this issue · comments
pytorchvideo最新代码,torch1.8的版本
File "C:\Users\Administrator/.cache\torch\hub\facebookresearch_pytorchvideo_master\pytorchvideo\layers\attention.py", line 13, in
@torch.fx.wrap
AttributeError: module 'torch' has no attribute 'fx'
pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
Installing collected packages: torchvision, torchaudio
Attempting uninstall: torchvision
Found existing installation: torchvision 0.8.2+cu101
Uninstalling torchvision-0.8.2+cu101:
Successfully uninstalled torchvision-0.8.2+cu101
Attempting uninstall: torchaudio
Found existing installation: torchaudio 0.7.2
Uninstalling torchaudio-0.7.2:
Successfully uninstalled torchaudio-0.7.2
Successfully installed torchaudio-0.8.1 torchvision-0.9.1+cu101
我新安装torch1.12版本,还是报同样的错
print(torch.version)
1.12.0+cpu
print(pytorchvideo.version)
'0.1.5'
File "E:\code\PyCharmCommunityEdition2021.3.2\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\Administrator/.cache\torch\hub\facebookresearch_pytorchvideo_main\pytorchvideo\layers\attention.py", line 13, in
@torch.fx.wrap
AttributeError: module 'torch' has no attribute 'fx'
import torch.fx
explictly on 'attention.py' file can solve this problem in my case.
Thanks for the catch! Added it to attention.py in a soon to be merged PR.