Pytorch报错记录
1.BrokenPipeError
执行以下命令时:
a,b = iter(train_loader).next()
报错:BrokenPipeError: [Errno 32] Broken pipe
错误原因:子进程原因
On Windows the subprocesses will import (i.e. execute) the main module at start. You need to insert an if __name__ == '__main__': guard in the main module to avoid creating subprocesses recursively.
解决方法:
Please see my edited response where I did exactly that. The requirement for wrapping the code inside of if __name__ == '__main__' code isn't immediately obvoius, as it is only required for Windows machines.就是说在windows下必须将上面的代码打包在if __name__ == '__main__'语句下面。这时不会报错了。
还有人说:I also got the same error. When I set num_workers to 0, the error does not appear again. However, when I set num_workers to 1, the error is still there.即将如下:
train_loader = data.DataLoader(dataset, batch_size=64, shuffle=True, num_workers=2, drop_last=False)
代码中的num_workers=0,但我改了以后还回报另外的错误。
2. 发现gpu并行运算出错,单个gpu没问题.
重新装了驱动:ubuntu18.04-rtx2080ti-nvidia driver 410.78-cuda9.0-cudnn-9.0-v7.5.1.10-将gcc和g++降级为4.8.
Pytorch报错记录的更多相关文章
- pytorch报错:ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1,512,1,1])
1.pytorch报错:ValueError: Expected more than 1 value per channel when training, got input size torch.S ...
- Pytorch报错:cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorMath.cu:26
Pytorch报错:cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/TH ...
- 报错记录(xml抬头报错)
报错记录(xml抬头报错) Referenced file contains errors (http://www.springframework.org/schema/beans/spring-be ...
- Anaconda 安装 pytorch报错解决方法
一.安装Pytorch: # -c 指定用pytorch镜像源下载软件conda install pytorch torchvision cpuonly -c pytorch 报错: 二.配置: ch ...
- IDEA 报错记录
IDEA 报错记录 Process finished with exit code 0 这种主要是配了默认的 Tomcat ,然后又配置了外部的 Tomcat.解决办法,注释掉默认的: <dep ...
- Spring Boot 报错记录
Spring Boot 报错记录 由于新建的项目没有配置数据库连接启动报错,可以通过取消自动数据源自动配置来解决 解决方案1: @SpringBootApplication(exclude = Dat ...
- Pytorch 报错总结
目前在学习pytorch,自己写了一些例子,在这里记录下来一些报错及总结 1. RuntimeError: Expected object of type torch.FloatTensor but ...
- 报错记录:getOutputStream() has already been called for this response
仅作记录:参考文章:http://www.blogjava.net/vickzhu/archive/2008/11/03/238337.html 报错信息: java.lang.IllegalStat ...
- g++ 6.4编译opencv-2.4.10报错记录
fetch公司的项目进行编译,此项目依赖opencv库.由于本人一直比较偏爱fedora,但也因此给我带来了许多"乐趣"(麻烦).fedora一直走得比较前沿,g++ 6.3了 ...
随机推荐
- Django学习笔记之表单验证
表单概述 HTML中的表单 单纯从前端的html来说,表单是用来提交数据给服务器的,不管后台的服务器用的是Django还是PHP语言还是其他语言.只要把input标签放在form标签中,然后再添加一个 ...
- 导出pdf功能
本程序下载地址: PDF是我们极其常用的文件格式,但对如何生成PDF,个人一直觉得很神秘,其实利用一些公开的PDF库,我们就可以直接生成PDF文件,而不用关注PDF文件的内部细节.我知道的PDF库有如 ...
- 从HTTL模板引擎看软件设计原则
HTTL (Hyper-Text Template Language) 是一个高性能的开源JAVA模板引擎, 适用于动态HTML页面输出, 可替代JSP页面, 指令和Velocity相似.作者是阿里巴 ...
- 早上一起来,就看到朋友圈发这个,慌的一 B
早上一起来,就看到朋友圈发这个,慌的一 B,也不知道是真是假- 图中的 c 表示已被确认,大家可以看到各个大厂真的是在大幅度裁员. 不知道明年的情况会如何,网上看到过一句话:2019 年也许是这 10 ...
- 第一个Jsp页面,基于普元EOS
跨界了.搞一下Jsp,实现MES系统看板一处.
- すぬけ君の塗り絵 / Snuke's Coloring AtCoder - 2068 (思维,排序,贡献)
Problem Statement We have a grid with H rows and W columns. At first, all cells were painted white. ...
- 控制结构(4): 局部化(localization)
// 上一篇:状态机(state machine) // 下一篇:必经之地(using) 基于语言提供的基本控制结构,更好地组织和表达程序,需要良好的控制结构. 前情回顾 上一次,我们说到状态机结构( ...
- mybatis源码分析(五)------------SQL的执行过程
在对SQL的执行过程进行分析前,先看下测试demo: /** * @author chenyk * @date 2018年8月20日 */ public class GoodsDaoTest { pr ...
- SpringCloud-Eureka服务注册与发现(二)
SpringCloud-Eureka服务注册与发现(二) https://www.cnblogs.com/qdhxhz/p/9357502.html https://blog.csdn.net/wei ...
- Windows 10 Update
services.msc Windows Update