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

AttributeError: module 'torch.utils' has no attribute 'data' #208

Open
tkp30 opened this issue Apr 26, 2020 · 1 comment
Open

AttributeError: module 'torch.utils' has no attribute 'data' #208

tkp30 opened this issue Apr 26, 2020 · 1 comment

Comments

@tkp30
Copy link

tkp30 commented Apr 26, 2020

当我执行这里的诗歌生成代码时,出现了一个问题:

Traceback (most recent call last):
  File "C:\Users\朋友的朋\Desktop\诗歌生成\main.py", line 259, in <module>
    train()
  File "C:\Users\朋友的朋\Desktop\诗歌生成\main.py", line 137, in train
    dataloader = t.utils.data.DataLoader(data,
AttributeError: module 'torch.utils' has no attribute 'data'

不知道什么意思,求指教。

@GarveyZ
Copy link

GarveyZ commented Nov 22, 2020

先看一下torch包中存不存在data这个方法。
如果不存在,重新安装torch
如果存在,看一下是不是torch没有声明。。。

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