成功解决AttributeError: module 'torch.utils' has no attribute 'data'

目录

解决问题

解决思路

解决方法


解决问题

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

解决思路

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

解决方法

只需在顶行添加此代码即可!
import torch.utils.data     #  新添加代码

import logging
import numpy as np
import torchfrom . import ava_helper as ava_helper
from . import cv2_transform as cv2_transform
from . import transform as transform
from . import utils as utilsfrom .build import DATASET_REGISTRYlogger = logging.getLogger(__name__)@DATASET_REGISTRY.register()
class Ava(torch.utils.data.Dataset):  """AVA Dataset"""def __init__(self, cfg, split):self.cfg = cfgself._split = split

更改为

import logging
import numpy as np
import torch
import torch.utils.data     #  新添加代码from . import ava_helper as ava_helper
from . import cv2_transform as cv2_transform
from . import transform as transform
from . import utils as utilsfrom .build import DATASET_REGISTRYlogger = logging.getLogger(__name__)@DATASET_REGISTRY.register()
class Ava(torch.utils.data.Dataset):  """AVA Dataset"""def __init__(self, cfg, split):self.cfg = cfgself._split = split

成功解决AttributeError: module 'torch.utils' has no attribute 'data'相关推荐

  1. 成功解决AttributeError: module ‘tornado.web‘ has no attribute ‘asynchronous‘

    成功解决AttributeError: module 'tornado.web' has no attribute 'asynchronous' 目录 解决问题 解决思路 解决方法 解决问题 Attr ...

  2. 成功解决AttributeError: module tensorflow.sets has no attribute intersection

    成功解决AttributeError: module tensorflow.sets   has no attribute intersection 目录 解决问题 解决思路 解决方法 T1.更新 t ...

  3. 成功解决AttributeError: module tensorflow.image has no attribute resize

    成功解决AttributeError: module tensorflow.image has no attribute resize 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...

  4. 成功解决AttributeError: module tensorflow.compat has no attribute v1

    成功解决AttributeError: module 'tensorflow.compat' has no attribute 'v1' 目录 解决问题 解决思路 解决方法 1.tf.Session ...

  5. 成功解决AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'和 'CV_CAP_PROP_FRAME_WIDTH'

    成功解决AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'和 'CV_CAP_PROP_FRAME_WIDTH' 目 ...

  6. 成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'

    成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...

  7. 成功解决AttributeError: module ‘scipy.sparse‘ has no attribute ‘coo_array‘

    成功解决AttributeError: module 'scipy.sparse' has no attribute 'coo_array' 目录 解决问题 解决思路 解决方法 T1.conda直接下 ...

  8. 成功解决 AttributeError: module ‘keras.engine.topology‘ has no attribute ‘load_weights_from_hdf5_group_b

    成功解决 AttributeError: module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_b ...

  9. 成功解决AttributeError: module ‘dask.array.numpy_compat‘ has no attribute ‘take_along_axis‘

    成功解决AttributeError: module 'dask.array.numpy_compat' has no attribute 'take_along_axis' 目录 解决问题 解决思路 ...

最新文章

  1. C#中方法参数的四种类型
  2. MIT中国博士生开发出第一套保护自动驾驶车辆的感知算法
  3. 清理你入侵后的三个重要痕迹
  4. redis有值查询返回null_redis运行lua脚本hmget返回值为空判断问题-Go语言中文社区...
  5. Shape Context
  6. 将结构体写入文件_将COCO检测结果写入json文件
  7. 从binlog恢复数据及Mysqlbinlog文件删除
  8. 【C++学习】C++中的强制转换
  9. Go的nil切片与空切片一样吗?这么答,面试官让回去等信儿
  10. 【金融申请评分卡】数据准备 - 造衍生变量
  11. BZOJ 1029: [JSOI2007]建筑抢修 优先队列
  12. 软件工程第二篇博客(“相等”)
  13. DateFormat的使用
  14. 免费好用的证件扫描仪-扫描全能王
  15. 用户行为序列推荐模型
  16. im2col的原理和实现
  17. Docker安装、配置国内镜像加速器
  18. 软件测试怎么自学?史上最全的「软件测试」自学路线图+资源包
  19. 英雄之舞—凌波微步(利用async.js编写异步动画)
  20. 项目开发过程中遇到的问题和解决方法

热门文章

  1. debian 使用 systemctl 且自启frp
  2. 学习spring过程看的笔记(一)
  3. 【译】光线跟踪:理论与实现(一) 简介
  4. 汉字内码UNICODE转换表
  5. python3图形界面简单案例(tkinter)
  6. 一次 Druid 连接池泄露引发的血案!
  7. Java 集合框架综述
  8. 我是如何拿到蚂蚁金服 offer ?
  9. 全球最厉害的 14 位程序员,请收下我的膝盖
  10. 也许,这样理解 HTTPS 更容易