pytorch terminate called after throwing an instance of ‘c10::HIPError‘

pytorch terminate called after throwing an instance of ‘c10::HIPError‘,第1张

今天在跑PPO程序的时候,出现了下面的错误:

terminate called after throwing an instance of 'c10::HIPError'
  what():  HIP error: hipErrorNoDevice
HIP kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing HIP_LAUNCH_BLOCKING=1.
Exception raised from deviceCount at /pytorch/aten/src/ATen/hip/impl/HIPGuardImplMasqueradingAsCUDA.h:102 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7f839e38ec72 in /root/anaconda3/lib/python3.7/site-packages/torch/lib/libc10.so)
frame #1:  + 0x4b3eaa (0x7f82bb4c2eaa in /root/anaconda3/lib/python3.7/site-packages/torch/lib/libtorch_hip.so)
frame #2: torch::autograd::Engine::start_device_threads() + 0x21a (0x7f83082beafa in /root/anaconda3/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so)
frame #3:  + 0xf907 (0x7f83c61fe907 in /lib/x86_64-linux-gnu/libpthread.so.0)
......

我的torch版本是:

torch                              1.11.0+rocm4.5.2
cuda 10.2
解决方法

回退torch版本到1.5

pip install torch==1.5

然后就可以运行了。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/867799.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-12
下一篇2022-05-12

发表评论

登录后才能评论

评论列表(0条)

    保存