EfficientUnet-PyTorch icon indicating copy to clipboard operation
EfficientUnet-PyTorch copied to clipboard

cannot import name 'load_state_dict_from_url'

Open cswwp opened this issue 5 years ago • 4 comments

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

cswwp avatar Oct 08 '19 03:10 cswwp

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.)

daisukelab avatar Oct 19 '19 22:10 daisukelab

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

jon-leun avatar Mar 21 '21 12:03 jon-leun

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.

harisgulzar1 avatar Aug 19 '21 13:08 harisgulzar1

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!

junkaih2019 avatar Nov 20 '21 15:11 junkaih2019