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了 ...
随机推荐
- 乡下人设计模式——SOLID之六大原则
S(Single Responsibility Principle):单一责任原则 O(Open Closed Principle):开放封闭原则 L(Liskov Substitution Prin ...
- 远程连接腾讯云服务器MySQL数据库
1.添加腾讯云安全组规则的MySQL 3306端口 将所有端口打开,至少打开3306,不在赘述. 2.打开更改MySQL配置文件 打开配置文件 vi /etc/mysql/mysql.conf.d/m ...
- 让多个HTML页面 使用 同一段HTML代码
需求背景 一个网站有多个网页:一个网页,可以分为很多部分,举个例子,下面是一个特别简单的网页结构: 一般情况下,footer都是用于标识网站的相关信息(备案.联系方式.制作方),每一个页面都是相 ...
- jdk 动态代理的原理
一.代理设计模式 代理设计模式是Java常用的设计模式之一. 特点: 01.委托类和代理类有共同的接口或者父类: 02.代理类负责为委托类处理消息,并将消息转发给委托类: 03.委托类和代理类对象通常 ...
- 如何去掉wordpress网站url里面的index.php(Apache服务器)
在wordpress根目录新建.htaccess文件,并拷贝以下代码保存即可. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase ...
- git 学习(2) ----- 分支
当我们进行程序开发的过程中,有时会产生一个新的想法,然后就想马上试验,那我们怎么办? 如果我们继续在现有的基础上进行开发,但最后想法不成功,我们还要进行版本回退?如果我们的新想法,需要很长时间才能实现 ...
- mpvue——引入vant_weapp组件
克隆仓库 克隆后,将dist目录下的所有文件复制到项目中的/static/vant/目录下,vant目录是我自己创建为了区分的 git clone https://github.com/youzan/ ...
- mpvue——页面跳转
两个页面 两个页面的跳转,只是单纯的A->B这种跳转. 组件 直接使用小程序的组件,navigator,里面还有一些其他的参数,大家可以自行翻阅官方文档 <navigator url=&q ...
- Codeforces 1077F2 Pictures with Kittens (hard version)(DP+单调队列优化)
题目链接:Pictures with Kittens (hard version) 题意:给定n长度的数字序列ai,求从中选出x个满足任意k长度区间都至少有一个被选到的最大和. 题解:数据量5000, ...
- P1962 斐波那契数列
题面是这样的,其实斐波那契我们之前也有接触过,并不是什么太陌生的玩意,第一个想到的方法其实是用递归来做,这样的话其实是非常轻松的,but同志们你们有没有关注过这样一个鬼东西 你以为蓝题是让你切着玩的吗 ...