记录一下自己遇到的问题和在网上查到的解决办法(更新中。。。如有侵权,请联系博主删除)
1、OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
解决方式:
在train.py中导入库的位置添加代码:
import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'
2、UserWarning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,or matplotlib.backends is imported for the first time.
解决方式:
在最开头添加以下代码:
import matplotlib
matplotlib.use('Agg')
3、yolov5训练时出现_pickle.UnpicklingError: STACK_GLOBAL requires str
解决办法:
yolov5训练时出现_pickle.UnpicklingError: STACK_GLOBAL requires str的解决办法_!传深的博客-CSDN博客4
4、RuntimeError: cannot perform reduction function max on tensor with no elements because the operation
解决方法:
将标签中的difficult节点为1的改为0
5、ERROR: Could not build wheels for pycocotools
解决方法:
下载Visual,在visual安装时要勾选c++和python。
如果已经安装了visual,想补充安装的话,首先找到开始菜单中的visual studio installer,打开后选择修改,再选择c++和python即可。如下图:
6、mmrotate报错:ModuleNotFoundError: No module named ‘mmcv._ext‘
解决方法:
更换mmcv-full版本,以下版本供参考:
cuda=10.1 torch=1.6.0 torchvision=0.7.0
mmcv-full==1.5.3 mmdet==2.25.0 mmrotate==0.3.2
安装mmcv采用如下命令:(cu101表示cuda10.1,torch1.6.0,都换成自己的版本)
pip install mmcv-full==1.5.3 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
7、EOFError: Ran out of input
检查一下权重文件是否为空
8、cv2.imshow报错
cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1274: error: (-2:Unspecified e
rror) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'
解决方法:
pip install opencv-contrib-python