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

cannot import name 'load_state_dict_from_url' #5

Open
cswwp opened this issue Oct 8, 2019 · 4 comments
Open

cannot import name 'load_state_dict_from_url' #5

cswwp opened this issue Oct 8, 2019 · 4 comments

Comments

@cswwp
Copy link

cswwp commented Oct 8, 2019

requires pytorch >1.0.0, my version is 1.0.1, i found v1.0.1 not support 'load_state_dict_from_url'
but >=1.1.0

@daisukelab
Copy link

Just FYI, I applied work-around with local change borrowing: https://github.com/pytorch/vision/blob/master/torchvision/models/utils.py

try:
    from torch.hub import load_state_dict_from_url
except ImportError:
    from torch.utils.model_zoo import load_url as load_state_dict_from_url

(Just dunno if applying this change is better or not in the future, I'm making local change.)

@jon-leun
Copy link

Just FYI, I applied work-around with local change borrowing: https://github.com/pytorch/vision/blob/master/torchvision/models/utils.py

try:
    from torch.hub import load_state_dict_from_url
except ImportError:
    from torch.utils.model_zoo import load_url as load_state_dict_from_url

(Just dunno if applying this change is better or not in the future, I'm making local change.)

great ! it works

hongxuanwei added a commit to hongxuanwei/vision that referenced this issue Apr 24, 2021
@harisgulzar1
Copy link

Just FYI, I applied work-around with local change borrowing: https://github.com/pytorch/vision/blob/master/torchvision/models/utils.py

try:
    from torch.hub import load_state_dict_from_url
except ImportError:
    from torch.utils.model_zoo import load_url as load_state_dict_from_url

(Just dunno if applying this change is better or not in the future, I'm making local change.)

Worked perfectly.

@junkaih2019
Copy link

Just FYI, I applied work-around with local change borrowing: https://github.com/pytorch/vision/blob/master/torchvision/models/utils.py

try:
    from torch.hub import load_state_dict_from_url
except ImportError:
    from torch.utils.model_zoo import load_url as load_state_dict_from_url

(Just dunno if applying this change is better or not in the future, I'm making local change.)

Solved perfectly! thanks!

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

5 participants