mmskeleton
mmskeleton copied to clipboard
torch version issue: cannot import name 'download_url_to_file' from 'torch.hub'
Hello
When I run this code,
python mmskl.py pose_demo [--gpus $GPUS]
I met this error
Traceback (most recent call last):
File "mmskl.py", line 7, in <module>
import mmskeleton
File "/content/mmskeleton/mmskeleton/__init__.py", line 1, in <module>
from . import utils
File "/content/mmskeleton/mmskeleton/utils/__init__.py", line 3, in <module>
from .checkpoint import load_checkpoint, get_mmskeleton_url, cache_checkpoint
File "/content/mmskeleton/mmskeleton/utils/checkpoint.py", line 1, in <module>
from mmcv.runner import load_checkpoint as mmcv_load_checkpoint
File "/usr/local/lib/python3.7/site-packages/mmcv-1.5.3-py3.7.egg/mmcv/__init__.py", line 4, in <module>
from .fileio import *
File "/usr/local/lib/python3.7/site-packages/mmcv-1.5.3-py3.7.egg/mmcv/fileio/__init__.py", line 2, in <module>
from .file_client import BaseStorageBackend, FileClient
File "/usr/local/lib/python3.7/site-packages/mmcv-1.5.3-py3.7.egg/mmcv/fileio/file_client.py", line 15, in <module>
from mmcv.utils.misc import has_method
File "/usr/local/lib/python3.7/site-packages/mmcv-1.5.3-py3.7.egg/mmcv/utils/__init__.py", line 41, in <module>
from .hub import load_url
File "/usr/local/lib/python3.7/site-packages/mmcv-1.5.3-py3.7.egg/mmcv/utils/hub.py", line 20, in <module>
from torch.hub import HASH_REGEX, _get_torch_home, download_url_to_file
ImportError: cannot import name 'download_url_to_file' from 'torch.hub' (/usr/local/lib/python3.7/site-packages/torch/hub.py)
So I search for the solution, but anything I can search is only 'torch version up'. (link1, link2)
I installed the version
# CUDA 9.2
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=9.2 -c pytorch
following Getting_started.md.
If Getting_started.md was wrong, What torch, torchvision version should be installed?
thanks for your help
@BrainNim did you figure it out?
@BrainNim did you figure it out?
unfortunately not
I've checked pytorch package in local/official package and figured out that this function download_url_to_file exists. This issue was fixed by modifying mmcv. Just add undersore symbol at the begging of function call in "/usr/local/lib/python3.7/site-packages/mmcv-1.5.3-py3.7.egg/mmcv/utils/hub.py": download_url_to_file -> _download_url_to_file
@fronos Thanks a lot!!