【Python报错】RuntimeError: DataLoader worker (pid(s) 9764, 15128) exited unexpectedly
batch_size = 2# 256
def get_dataloader_workers(): #@save
"""使用4个进程来读取数据。"""
return 4 train_iter = data.DataLoader(mnist_train, batch_size, shuffle=True, num_workers=get_dataloader_workers()) timer = d2l.Timer()
for X, y in train_iter:
continue
f'{timer.stop():.2f} sec'
问题:动手学深度学习2.0,softmax回归,读取小批量数据是出现超时报错。具体如下:


我的环境是:Anaconda 的虚拟环境,使用jupyter notebook进行编译,电脑是联想拯救者R720,i5处理器;
我所使用的CPU运行,最初是批量256张图片数据,同时使用4线程进行读取,此时会报错!
查阅网上的回答,说最可能的原因是;
- cuda 虚拟环境的共享内存不足,解决办法是,要么改成更小的batchsize,
- 将numworkers = 4注释掉,不用多进程
解决过程:
1、只将batchsize改小,变为2,依旧报错
2、将进程num_workers=get_dataloader_workers()改为0、1、2可以使用

估计还是电脑太差了不太行的缘故,毕竟用了快四年了。
【Python报错】RuntimeError: DataLoader worker (pid(s) 9764, 15128) exited unexpectedly的更多相关文章
- RuntimeError: DataLoader worker (pid 18255) is killed by signal: Killed.
RuntimeError: DataLoader worker (pid 18255) is killed by signal: Killed. 通过观察内存发现,数据加载过程中内存会被耗尽.
- python 报错RuntimeError: dictionary changed size during iteration
a = {':0} for b in list(a.keys()): if a[b] == 0: del a[b] print(a) 报错是因为在字典迭代期间改变字典大小 我们可以通过取出字典的键值, ...
- ssh调用matplotlib绘图报错RuntimeError: Invalid DISPLAY variable
1.问题:在本地用matplotlib绘图可以,但是在ssh远程绘图的时候会报错 RuntimeError: Invalid DISPLAY variable 2.原因:matplotlib的默认ba ...
- 安装tesserocr的步骤和报错RuntimeError: Failed to init API, possibly an invalid tessdata path解决办法
1,首先下载合适的tesseract-ocr的版本 2,然后安装到这一步注意要勾选这一项来安装OCR识别支持的语言包,这样OCR就可以识别多国语言,然后就可以一直点击下一步完成安装. 3,安装tess ...
- Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you have APPEND_SLASH set.
Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and ...
- Django:提交表单报错:RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you have A
Django:提交表单报错:RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you ...
- Python报错总结丶自定义报错
Python报错总结: 常见异常 1,NameError: name 'a' is not defined:未定义函数名 2,IndentationError: uninden ...
- Python报错module 'scipy.misc' has no attribute 'xxx'
Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...
- selenium python 报错“ unable to find binary in default location”
selenium python 报错如下: raise exception_class(message, screen, stacktrace)selenium.common.exceptions.W ...
随机推荐
- mybatis常用功能总结
mybatis-plus常用功能总结-以User表为例 1.数据库 id name age email create_time update_time version deleted 1 mary 2 ...
- Day009 二维数组
多维数组 多维数组是数组的嵌套(数组的元素是数组,数组的数组元素的元素是数组...),比如二维数组就是一个特殊的一维数组,其每一个元素都是一个一维数组. 二维数组 int a[][]=new int ...
- SSM整合大体步骤
SSM整合步骤: 1. 导入jar spring: springMVC: mybatis: 第三方支持:log4j,pageHelper,AspectJ,jackson,jstl 2. 搭建sprin ...
- C#中的元组(Tuple)和结构体(struct)
在正常的函数调用中,一个函数只能返回一个类型的值,但在某些特殊情况下,我们可能需要一个方法返回多个类型的值,除了通过ref,out或者泛型集合可以实现这种需求外,今天,讲一下元组和结构体在这一方面的应 ...
- nginx日志文件按天记录定时清理循环记录
问题 nginx日志默认记录在一个文件access.log中,时间长了会导致日志文件特别大,甚至磁盘占满. 解决方案 使用以下方法,将access.log文件每天一个,然后清过15天以前的文件. 方法 ...
- [c++] 文件包含
当一个类用到另一个类时,有两种包含方式,在.h中包含和在.cpp中包含 用到公共类库时,在.h文件中包含(公共类库可视为不变的) 用到项目开发过程中自己或同事写的类时,在.cpp文件中包含(可能根据需 ...
- MegaRAID BIOS设置阵列
MegaRAID BIOS设置阵列 1.在初始界面可以看到physical View的界面,或者在左侧的菜单栏中点击选中即可,可以看到物理磁盘. 2.点击上一步的配置向导可以进入到配置向导界面 3.选 ...
- Linux创建RAID概述
Linux创建RAID RAID概述 RAID(Redundant Array of Independent Disk)虚拟存储系统 RAID即独立冗余磁盘阵列,其思想是将多块独立的磁盘按不同的方式组 ...
- mysql有关配置
mysql有关配置 mysql安装 mysql安装方式有三种 源代码:编译安装 二进制格式的程序包:展开至特定路径,并经过简单配置后即可使用 程序包管理器管理的程序包: rpm:有两种 OS Vend ...
- 基于LNMP架构搭建wordpress个人博客
搭建过程 注意防火墙和selinux的影响可以先关闭. 一.安装nginx # 1.更改nginx源安装nginx [root@web01 ~]# vi /etc/yum.repos.d/nginx. ...