![](https://img-blog.csdnimg.cn/20190918140145169.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Error
pytorch, python, linux系统报错
后悔大鲨鱼
这个作者很懒,什么都没留下…
展开
-
RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
RuntimeError: Unable to find a valid cuDNN algorithm to run convolutionTo solve my problem, I didpip uninstall torch torchvision torchaudioThenpip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytor.转载 2022-04-20 11:56:39 · 1490 阅读 · 2 评论 -
CentOS 普通权限安装包(无法使用yum时从rpm手动安装)
CentOS中普通权限(非root)用户无法使用 yum 安装包解决方法:第一步,从仓库里面下载rpm包yumdownloader p7zip# 以安装p7zip举例,其他包是一样的步骤但是用 rpm 命令同样无法把该包安装到系统下,因为要写到一些关键目录,比如/usr/bin第二步,解压rpm包放在自己的目录下rpm2cpio p7zip-16.02-20.el7.x86_64.rpm | cpio -idvm这样就会按包里的目录结构解压到当前目录第三步,在...原创 2021-10-15 18:27:53 · 1962 阅读 · 0 评论 -
RuntimeError: “slow_conv_transpose2d_out_cpu“ not implemented for ‘Half‘
场景:使用CPU生成解决:原创 2021-08-30 10:17:52 · 5477 阅读 · 1 评论 -
Ubuntu安装OpenEXR报错 ERROR: Failed building wheel for OpenEXR
报错:解决:安装zlibig-dev 和libopenexr-dev成功解决:原创 2021-08-04 14:55:10 · 1395 阅读 · 6 评论 -
RuntimeError: The size of tensor a (128) must match the size of tensor b (32) at non-singleton dimen
我的问题:网络输入大小是固定的,没有resize输入图像。其他问题:(13条消息) RuntimeError: The size of tensor a (128) must match the size of tensor b (32) at non-singleton dimen_S20144144的博客-CSDN博客原创 2021-07-28 16:18:07 · 3126 阅读 · 3 评论 -
RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1.
读参数时,用map_location,gpu 1 -> gpu 0torch.load('modelparameters.pth', map_location={'cuda:1':'cuda:0'})参考:pytorch cpu与gpu load时相互转化 torch.load(map_location=)_bc521bc的博客-CSDN博客原创 2021-07-23 11:09:35 · 430 阅读 · 0 评论 -
RuntimeError: Address already in use
TCP的端口被占用,一种解决方法是,运行程序的同时指定端口,端口号随意给出:--master_port 295011另一种方式,查找占用的端口号(在程序里 插入print输出),然后找到该端口号对应的PID值:netstat -nltp,然后通过kill -9 PID来解除对该端口的占用————————————————版权声明:本文为CSDN博主「狐言乱雨」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/K原创 2021-06-09 12:39:21 · 6201 阅读 · 3 评论 -
ERROR | Corrupt JPEG data: 111 extraneous bytes before marker 0xd9...
问题描述Corrupt JPEG data: 1 extraneous bytes before marker 0xdblibpng warning: iCCP: known incorrect sRGB profilePremature end of JPEG filePremature end of JPEG filePremature end of JPEG filePremature end of JPEG file使用opencv(python)读取图片时,报如上错误,据说是因为.转载 2021-04-21 16:47:14 · 2441 阅读 · 0 评论 -
ERROR | RuntimeError: Python 3.5 or later is required
使用conda创建了虚拟环境(python=3.4.5)之后,无法使用pip安装包,提示错误如下:RuntimeError: Python 3.5 or later is required经过排查,最后锁定错误原因为:pip版本与python版本不一致(具体原因未知,因为pip是自动安装的)解决方法:1、 卸载pip2、 conda install "pip<19.2" python=3.4————————————————版权声明:本文为CSDN博主「想念@思恋」...转载 2021-04-21 16:45:45 · 1022 阅读 · 0 评论 -
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 224 and 266
查到了两个解决方案,其一如下,经过查验不是这个原因造成了我的错误:原链接:https://www.cnblogs.com/zxj9487/p/11531888.html解决:RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 544 and 1935 in dimension 2 at ../aten/src/TH/generic/THTensor.cpp:711这种错误原创 2020-10-28 16:10:03 · 919 阅读 · 0 评论 -
pytorch----RuntimeError: Error(s) in loading state_dict for Alexnet:Missing key(s) in state_dict:
问题,预测时报错:RuntimeError: Error(s) in loading state_dict for Alexnet: Missing key(s) in state_dict: Unexpected key(s) in state_dict:原因:训练时使用model = nn.DataParallel(model) cudnn.benchmark = True进行加速,预测时没有使用解决方法:预测时要加上: model = nn.DataPa...原创 2020-10-15 20:11:34 · 910 阅读 · 0 评论 -
ImportError: libGL.so.1: cannot open shared object file: No such file or directory缺少共享库
原因:缺少共享库解决方法:1. centos:(1)yum install mesa-libGL.x86_64,测试可用(2)查到的方法,没有测试过2. Ubuntu:sudo apt updatesudo apt install libgl1-mesa-glx可能容器内没有sudo指令可以apt-get updateapt-get install sudo引用[1]:https://www.ohazyi.com/docker-docs/[2]:http...原创 2020-10-09 19:59:07 · 15761 阅读 · 3 评论 -
ERROR----docker修改挂载目录下文件没权限
问题:向挂载目录写文件/修改文件时permission denied解决方法:在宿主机上开启挂载目录的权限如: chmod a+rwx /home/user/原创 2020-10-09 14:43:00 · 888 阅读 · 0 评论 -
Error:Given input size: (256x4x2). Calculated output size: (256x1x0). Output size is too small
Traceback (most recent call last): File "cls_set.py", line 62, in <module> main() File "cls_set.py", line 50, in main output = model(input_var) File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __.原创 2020-09-24 09:47:06 · 12179 阅读 · 13 评论 -
gdb查看core文件&signal7,Bus error解决
[root@885029f65484 deepbiq]# gdb ./a.outGNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-119.el7Copyright (C) 2013 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you .原创 2020-09-21 17:27:22 · 2469 阅读 · 0 评论 -
pytorch----torchsummary报错TypeError: ‘module‘ object is not callable
Usagepip install torchsummary or git clone https://github.com/sksq96/pytorch-summaryfrom torchsummary import summarysummary(your_model, input_size=(channels, H, W))Note that theinput_sizeis required to make a forward pass through the networ...原创 2020-09-10 16:16:29 · 3499 阅读 · 1 评论 -
pytorch----Error:dict object has no attribute eval
问题:原因:没有创建model实例解决方法:转载 2020-09-09 14:44:42 · 10345 阅读 · 0 评论 -
pytorch----维度不匹配
报错:Expected 4-dimensional input for 4-dimensional weight 64 3 11 11, but got 3-dimensional input of size [3, 224, 224] instead解决办法np.array:img = np.expand_dims(img,0)tensor:torch.unsqueeze(input, dim=0).float()example...原创 2020-09-09 10:26:05 · 4480 阅读 · 0 评论 -
pytorch----Target 2 is out of bounds
问题:多分类网络加了两层全连接后最后输出1类,计算loss时报错Target Nis out of bounds其中的N其实就是处理的数据输入的标签,即第几类,是一个代表类别的整数,最后输出1类与输入的target不符就会报错解决方法:查看网络的最后输出,softmax的输出节点数是否等于所有的标签数。...原创 2020-09-09 10:15:09 · 12892 阅读 · 3 评论 -
PyTorch中的常见报错总结
Pytorch中报错报错信息非常多,这里简单总结十六种常见的报错信息,方便大家Debug1报错:ValueError: num_samples should be a positive integer value, but got num_samples=0可能的原因:传入的Dataset中的len(self.data_info)==0,即传入该dataloader的dataset里没有数据解决方法:检查dataset中的路径,路径不对,读取不到数据检查Dataset的__len_.转载 2020-08-26 10:16:36 · 988 阅读 · 0 评论 -
pytorch踩坑
1. nn.Module.cuda() 和 Tensor.cuda() 的作用效果差异无论是对于模型还是数据,cuda()函数都能实现从CPU到GPU的内存迁移,但是他们的作用效果有所不同。对于nn.Module: model = model.cuda() model.cuda() 上面两句能够达到一样的效果,即对model自身进行的内存迁移。对于Tensor:和nn.Module不同,调用tensor.cuda()只是返回这个tensor对象在GPU内存上的拷贝,转载 2020-08-24 16:25:44 · 2265 阅读 · 0 评论 -
docker 运行pytorch 程序报错---ERROR: Unexpected bus error encountered in worker.
1. 错误:ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).2. 原因:Pytorch的IPC会利用共享内存,所以对于当前代码运行环境的共享内存必须足够大3. 解决方法:(1)修改当前Docker的shm-sizedocker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0转载 2020-08-21 16:33:12 · 7339 阅读 · 8 评论 -
用shell调用python报ImportError
问题描述:python调用torch包,在ipython/ide/terminal直接运行都可以,shell调用python文件时报错ImportError原因:shell找的解释器与python不是一个路径,应该是PYTHONPATH的问题。但是用sys.path输出的path加进环境变量后,site-packages中的site.py文件有报错:解决方法:把shell中写的python test.py 改成 python3 test.py碎碎念:不算完全解决但是凑活用吧,有.原创 2020-08-14 16:36:45 · 738 阅读 · 0 评论 -
深度学习输入不同预测结果相同或类似
问题:SVR模型在训练过程中进行预测时,使用测试集和验证集效果不错。但是训练好之后,加载模型进行预测时,不同的输入都预测出相同的结果。解决方法:归一化问题,预测时要与训练时用同一个scale_fit归一化。训练时归一化scale = StandardScaler()scale_x= scale.fit(x)x = scale_x.transform(x)预测时用同一个scale_x归一化,再预测x_ test= scale_x.transform(x_test)clf = jo.原创 2020-06-09 11:30:27 · 3563 阅读 · 1 评论 -
Centos7出现ImportError: No module named Tkinter
安装python工具tkinter库:sudo yum install python-tools原创 2019-11-21 11:27:47 · 163 阅读 · 0 评论 -
centos7安装cmake+boost+OpenCV+caffe踩坑总结
这个环境充满血泪,几点重要事项写在前面提醒自己:1.安装环境之前一定先确认版本2.安装不同库确认库之间的适配版本3.做好文件备份4.做好安装位置的记录换版本心力交瘁,找不到路径抓心挠肝,缝缝补补到最后直接重新安装的,幸好用的docker在容器中操作,不然不知道要缝补到啥时候。。。在这种低级错误上浪费了好多时间,不过也算是搞清楚了Makefile.config CMakelist...原创 2019-11-21 11:26:59 · 1597 阅读 · 0 评论 -
python报错------NoneType’ object is not iterable
参考链接:https://blog.csdn.net/weixin_43646491/article/details/84288750Type错误:“NoneType”对象不是可迭代的一般出现在 将None返回给了多个值 遍历的对象为None 例 : item = None for i in item: print(i) 解决 :加判断item是否为None即可...转载 2019-11-05 15:04:48 · 5032 阅读 · 0 评论