AttributeError: module ‘torch.utils‘ has no attribute ‘data‘

一、解决问题

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

二、解决思路

属性错误:模块的'torch.utils'没有属性'data'

三、解决方法

只需在顶行添加此代码即可!

import torch.utils.data     #  新添加代码

猜你喜欢

转载自blog.csdn.net/qq_39237205/article/details/124201498
今日推荐