cuda runtime error (2) : out of memory解决_program hit out of memory (error 2) on cuda api ca
作者:IT小白 | 2024-03-11 20:44:50
赞
踩
program hit out of memory (error 2) on cuda api call to cudastreamcreatewith
cuda runtime error (2) : out of memory解决
报错如图 一般遇到out of memory的情况都是服务器的容器上在跑别的程序或是内存没释放,模型太大等,不过这次出现这个错误用nvidia-smi试了下,容器只用了10MB,模型也是不可能超内存的。后来查了下应该在DataLoader中加入pin_memory=False,改完之后,程序立马跑通。