CornerNet-lite
error
运行环境:ubuntu 18.04 cuda 10.1, pytorch 1.1, python 3.5
问题:程序已经正常加载,跑了几个(不固定,有时十几个,有时能五六十个)batch后,报错如下图:
单看错误消息,是调用lef_pool(cornernet中是c++实现的)的backward错误导致的,没找到解决办法;
最终解决方案:换系统和cuda,ubuntu 16.04 + pytorch 1.1 + python 3.5搞定
Dimension out of range
错误日志:file “/home/jhsu/code/CornerNet_Lite/core/models/py_utils/losses.py”, line 26, in _ae_loss
dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2)
IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 2)
解决方案:因为把batchsize设置为1了,调大即可
其它
- python pytorch segmentation fault
运行环境:ubuntu 16.04, pytorch 0.4.1, cuda 9.1, python 3.6
问题:程序已经正常加载,开始运行,直接报“segmentation fault ”,没有其它任何错误信息。
解决方案:
a. 网上有人说把ulimit -s 调大后可以解决,我试过不行;
b. 卸载pytorch0.4.1,换成torch 1.0.1后解决;
DETR
github:https://github.com/facebookresearch/detr
from pycocotools import mask as coco_mask
出现错误信息:
File “pycocotools/_mask.pyx”, line 1, in init pycocotools._mask
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
解决办法:
方法一:重新安装pycocotools
pip uninstall pycocotools
pip install pycocotools
pycocotools从2.0更新到2.0.2
方法二:更新numpy
pip install numpy
pip install numpy
numpy从1.16.5更新到1.20
两种方法都能解决上述问题,但是方法二会产生另外的问题:
File “/sujh/env/env_detr/lib/python3.7/site-packages/numpy/core/function_base.py”, line 120, in linspace
num = operator.index(num)
TypeError: ‘numpy.float64’ object cannot be interpreted as an integer
这个问题是由于numpy版本太高导致的,因此方法二其实没法用。