pytorch报错:Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass RuntimeError: FIND was unable to find an engine to execute this computatio

GPU模式下运行pytorch代码报错,pytorch为2.2.1,NVIDIA驱动版本535.161.07



File "/home/devil/anaconda3/envs/sample-factory/lib/python3.11/site-packages/torch/_tensor.py", line 522, in backward
torch.autograd.backward(
File "/home/devil/anaconda3/envs/sample-factory/lib/python3.11/site-packages/torch/autograd/init.py", line 266, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: FIND was unable to find an engine to execute this computatio



注意,这个其实不是报错,应该是警告,warning,因为没有影响代码的正常运行。




外网给出的解释:

  1. 地址:

https://github.com/Megvii-BaseDetection/YOLOX/issues/1642

image


  1. 地址:

https://discuss.pytorch.org/t/runtimeerror-get-was-unable-to-find-an-engine-to-execute-this-computation/193625/6

image


  1. 地址:

https://discuss.pytorch.org/t/runtimeerror-get-was-unable-to-find-an-engine-to-execute-this-computation/193625/3

image



总结来说,这个问题的出现是因为NVIDIA驱动版本过低了,一般是因为你选择使用了最新的版本的pytorch,因而使用配套的cuda和cudnn需要更高的版本的NVIDIA驱动(假设你使用conda安装pytorch,因此cuda和cudnn版本是已设置好的,没有问题,只有问题出现在驱动上),因此解决该问题就是需要更换一个更高版本的NVIDIA驱动。


PS. 如果你是使用多人共享的环境,如服务器,更新显卡驱动明显是一个麻烦和可行性低的选择,那么你可以换一个思路,那就是换用一个低版本的pytorch,这样同样可以解决这个问题。



posted on 2024-03-03 14:24  Angry_Panda  阅读(3415)  评论(2)    收藏  举报

导航