rotation-yolov5
rotation-yolov5 copied to clipboard
运行detect.py时遇到了问题,这该怎么解决呢
Fusing layers...
Model Summary: 188 layers, 2.22122e+07 parameters, 0 gradients
image 1/1 D:\Weld inspection\YOLOv5\rotation-yolov5-master\inference\images\1.tif: Traceback (most recent call last):
File "D:\Weld inspection\YOLOv5\rotation-yolov5-master\detect.py", line 174, in
这个错误只要把OpenCV版本切换到4.2即可解决,但是又遇到了新问题如下,猜想会不会是因为torch的版本问题,我想将torch版本切换到1.6可是,提示我不能切换。
image 1/1 D:\Weld inspection\YOLOv5\rotation-yolov5-master\inference\images\1.tif: D:\Weld inspection\YOLOv5\rotation-yolov5-master\venv\lib\site-packages\torch\nn\functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at ..\c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
Traceback (most recent call last):
File "D:/Weld inspection/YOLOv5/rotation-yolov5-master/detect.py", line 174, in
如果不是用gpu的话,而且这些库装的全是最新版的话,只要改两个地方,一个是self.inplace删掉,一个是把OpenCV-Python的版本改为4.2,完成这两个就能使用cpu执行detect.py了。作者的只能识别航拍中的船,
其余的应该要自己训练,
如果想使用gpu,我猜,不同于在YOLOv5.v5中,只要安装适合自己电脑的cuda和cudnn,再安装pytorch框架即可,而要安装作者指定的版本。
非常感谢您的解决方案,关于opencv的问题,只需要把getRotationMatrix2D参数改为int就可以了,就像作者说的后面的opencv可能不支持double