一、RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation
解决办法:在第148行下添加一行with torch.no_grad():
参考文章:RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation_一起变胖吧的博客-CSDN博客
二、RuntimeError: No such operator torchvision::nms
解决办法:pytorch和torchvision的版本不匹配,查找相对应的版本并重装
参考文章:RuntimeError: No such operator torchvision::nms问题解决方法_StrongerTang的博客-CSDN博客
arm64下安装pytorch,torchvision,torchaudio以及它们之间的版本对应关系_SimonLiu009的博客-CSDN博客_arm64 pytorch
三、TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.
解决办法:根据提示在tensor.py中第678行添加.cpu()
参考文章:Pycharm中运行yolov5-pytorch出现错误“TypeError: can‘t convert cuda:0 device type tensor to numpy....“_明德zhuang的博客-CSDN博客四、AttributeError: 'Hardswish' object has no attribute 'inplace'
解决办法:根据提示定位到activation.py 中第475行,将input后的删掉
参考文章:yolov5报错:AttributeError: ‘Hardswish‘ object has no attribute ‘inplace‘_长沙有肥鱼的博客-CSDN博客
五、AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
解决办法:在detect.py运行过程中报错,根据提示定位到upsampling.py中的153行,将代码改成如下
参考文章: AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘_阳光不锈@的博客-CSDN博客
版权归原作者 Pysonmi 所有, 如有侵权,请联系我们删除。