成功解决AttributeError: module 'torch.utils' has no attribute 'data'
成功解决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'相关推荐
- 成功解决AttributeError: module ‘tornado.web‘ has no attribute ‘asynchronous‘
成功解决AttributeError: module 'tornado.web' has no attribute 'asynchronous' 目录 解决问题 解决思路 解决方法 解决问题 Attr ...
- 成功解决AttributeError: module tensorflow.sets has no attribute intersection
成功解决AttributeError: module tensorflow.sets has no attribute intersection 目录 解决问题 解决思路 解决方法 T1.更新 t ...
- 成功解决AttributeError: module tensorflow.image has no attribute resize
成功解决AttributeError: module tensorflow.image has no attribute resize 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...
- 成功解决AttributeError: module tensorflow.compat has no attribute v1
成功解决AttributeError: module 'tensorflow.compat' has no attribute 'v1' 目录 解决问题 解决思路 解决方法 1.tf.Session ...
- 成功解决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' 目 ...
- 成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...
- 成功解决AttributeError: module ‘scipy.sparse‘ has no attribute ‘coo_array‘
成功解决AttributeError: module 'scipy.sparse' has no attribute 'coo_array' 目录 解决问题 解决思路 解决方法 T1.conda直接下 ...
- 成功解决 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 ...
- 成功解决AttributeError: module ‘dask.array.numpy_compat‘ has no attribute ‘take_along_axis‘
成功解决AttributeError: module 'dask.array.numpy_compat' has no attribute 'take_along_axis' 目录 解决问题 解决思路 ...
最新文章
- C#中方法参数的四种类型
- MIT中国博士生开发出第一套保护自动驾驶车辆的感知算法
- 清理你入侵后的三个重要痕迹
- redis有值查询返回null_redis运行lua脚本hmget返回值为空判断问题-Go语言中文社区...
- Shape Context
- 将结构体写入文件_将COCO检测结果写入json文件
- 从binlog恢复数据及Mysqlbinlog文件删除
- 【C++学习】C++中的强制转换
- Go的nil切片与空切片一样吗?这么答,面试官让回去等信儿
- 【金融申请评分卡】数据准备 - 造衍生变量
- BZOJ 1029: [JSOI2007]建筑抢修 优先队列
- 软件工程第二篇博客(“相等”)
- DateFormat的使用
- 免费好用的证件扫描仪-扫描全能王
- 用户行为序列推荐模型
- im2col的原理和实现
- Docker安装、配置国内镜像加速器
- 软件测试怎么自学?史上最全的「软件测试」自学路线图+资源包
- 英雄之舞—凌波微步(利用async.js编写异步动画)
- 项目开发过程中遇到的问题和解决方法