问题描述:在跑YOLOV5S代码时,出现了下面这个错误。
NotImplementedError: Could not run 'torchvision::nms' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'torchvision::nms' is only available for these backends: [CPU, QuantizedCPU, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, Tracer, AutocastCPU, AutocastCUDA, FuncTorchBatched, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PythonDispatcher].
原因分析:网上说的是cuda的版本和torch的版本不对应。但是自己明明是在pytorch的官网上下载的呀,并且自己的电脑上的cuda版本是11.8,但是pytorch官网上的cuda的最高版本是11.7,我复制里面的命令安装的,但是运行还是出现了上面的错误。具体错误如图片所示:
文章来源:https://www.toymoban.com/news/detail-572142.html
解决办法:我在其他帖子那看到这样操作就可以了。 他把torch的版本和cuda的版本都降了下来,没想到竟然跑起来了文章来源地址https://www.toymoban.com/news/detail-572142.html
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio===0.9.0 -f https://download.pytorch.org/whl/torch_stable.html -i https://pypi.douban.com/simple
到了这里,关于NotImplementedError: Could not run ‘torchvision::nms‘ with arguments from the ‘CUDA‘ backend.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!