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

训练出错,ImportError: cannot import name '_DataLoaderIter' #22

Open
zyf1040895256 opened this issue Jul 21, 2021 · 1 comment
Open

Comments

@zyf1040895256
Copy link

感谢您的工作,我有一个问题。当我用DF2K训练时,发现报错信息:

Traceback (most recent call last):
File "main.py", line 4, in
import data
File "/home/XXXX/F/XXX/DASR/data/init.py", line 2, in
from dataloader import MSDataLoader
File "/home/XXXX/F/XXX/DASR/dataloader.py", line 12, in
from torch.utils.data.dataloader import _DataLoaderIter
ImportError: cannot import name '_DataLoaderIter'

我的环境是:

torch 1.1.0
能解决下吗?

@LongguangWang
Copy link
Member

Hi @zyf1040895256, 感谢对我们工作的关注。
首先,请再次确认下运行DASR代码时使用的环境是不是pytorch 1.1.0。在1.1.0版本应该不会出现_DataLoaderIter载入错误的。
其次,可以尝试将_DataLoaderIter类(连接)复制到你的torch.utils.data.dataloader.py中,应该也可以解决这个问题。
另外,也可以参考这个回答将DASR中数据读取部分的代码替换为EDSR 1.2.0版本中的数据读取代码。

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

2 participants