![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
错误集锦
「已注销」
这个作者很懒,什么都没留下…
展开
-
Python运行时出现: takes no arguments错误提示
https://blog.csdn.net/guangwulv/article/details/101225431原创 2021-03-29 09:56:29 · 799 阅读 · 0 评论 -
【已解决】【读取图像以及标签应该人为设置类型】Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor)
1 问题描述Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same输入input和参数weight类型应该一致。2 分析经过查找后,发现在读取图片和标签的时候,并没有对其类型进行转化,就可能根据图像本身的大小设置,代码中出现的类型刚开始是float32,后边有的图像是float64,导致输入与参数类型不匹配。3 结论读取图像和标签时,应该人为设定其类型,将所有的数据转化原创 2021-03-04 18:30:02 · 2568 阅读 · 1 评论 -
【pytorch】【已解决】RuntimeError: stack expects each tensor to be equal size, but got [4, 448, 448] at ent
详细错误:Traceback (most recent call last): File "/home/yjys/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate return torch.stack(batch, 0, out=out)RuntimeError: stack expects each tensor to be equal原创 2021-03-04 16:03:34 · 18631 阅读 · 7 评论 -
【C++】【已解决】error C4996: ‘strcpy‘: This function or variable may be unsafe
引用文章:error C4996原创 2021-02-22 18:46:39 · 325 阅读 · 0 评论 -
【pytorch】【解决】【GPU下】RuntimeError: CUDA error: device-side assert triggered
错误:在GPU 下训练网络出现这样的错误,step=45前运行的很顺利,但是一到step=46就冒出这样的错误。一开始以为是内存不足,但是减少batch_size后并不能运行。尝试:有博客评论讲在CPU下运行错误就明显报出来了。于是出现下述错误:# pytorch----Target 200 is out of bounds这就说明了有样本的标签超出了样本类别数,后来仔细想想发现,一共200个样本,标记为1~200,可能是此处的错误。更改为0~199后就没有问题了。另外:为什么程序总是在ste=原创 2021-01-31 19:37:32 · 1398 阅读 · 0 评论 -
【pytorch】【解决】RuntimeError: Integer division of tensors using div or / is no longer supported
x = torch.tensor([1,2,3])n = 10print(x/n)运行结果:Traceback (most recent call last): File "/home/yjys/PycharmProjects/TEST/validation/test/torch_test.py", line 22, in <module> print(x/n)RuntimeError: Integer division of tensors using div or /原创 2021-01-02 14:28:20 · 847 阅读 · 0 评论 -
【numpy】【解决】ValueError: axes don‘t match array
ValueError: axes don't match array使用numpy处理图片时,出现此错误,大概率是因为文件下边的图有的是单通道的,有的是三通道的。可以使用skimage包转为RGB格式。from skimage.color import gray2rgbimg = io.imread(img_path)if len(img.shape) == 2: img = gray2rgb(img)...原创 2021-01-02 14:03:40 · 11826 阅读 · 1 评论