sanghyun-son / EDSR-PyTorch

PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)
MIT License
2.42k stars 668 forks source link

ImportError: cannot import name 'DataLoaderIter' #31

Closed ABDOELSHEMY closed 6 years ago

ABDOELSHEMY commented 6 years ago

hi @thstkdgus35 thank you for your great work in this project i try to test with in windows python main.py --data_test Demo --scale 4 --pre_train ../experiment/model/EDSR_baseline_x4.pt --test_only --save_results but i get this erro

python main.py --data_test Demo --scale 4 --pre_train ../experiment/model/EDSR_baseline_x4.pt --test_only --save_resu lts Traceback (most recent call last): File "main.py", line 4, in import data File "D:\EDSR PyTorch\code\data__init.py", line 3, in from dataloader import MSDataLoader File "D:\EDSR PyTorch\code\dataloader.py", line 13, in from torch.utils.data.dataloader import DataLoaderIter ImportError: cannot import name 'DataLoaderIter' Traceback (most recent call last): File "main.py", line 4, in import data File "D:\EDSR PyTorch\code\data\init__.py", line 3, in from dataloader import MSDataLoader File "D:\EDSR PyTorch\code\dataloader.py", line 13, in from torch.utils.data.dataloader import DataL

how can i solve this please.

hak23 commented 6 years ago

This is because of the pytorch update. DataLoaderIter was underscore suffixed to prevent subclassing. I think a quick non-code fix would be to move to pytorch 0.3.1, until it is fixed in this code, IMHO.

sanghyun-son commented 6 years ago

As hak23 said, that error occurs due to the PyTorch update.

Fortunately, I pushed a commit for PyTorch 0.4.0 yesterday.

Although I did not test my code on Windows, I think it will work fine.

Thank you!

ABDOELSHEMY commented 6 years ago

thank you @hak23 and @thstkdgus35 for your help i use the last EDSR Project update, Unfortunately seem like we need some time to things works well in new PyTorch windows, thank you sir.