美文网首页
cuda run out of memory 和 signal

cuda run out of memory 和 signal

作者: 啊啊啊啊啊1231 | 来源:发表于2019-12-20 14:41 被阅读0次

无论batch-size设置多小也是会出现这个问题的,我的原因是我将pytorch升级到了1.0.1,然后出现了这个问题

RuntimeError: CUDA out of memory. Tried to allocate 823.88 MiB (GPU 0; 7.93 GiB total capacity; 6.96 GiB already allocated; 189.31 MiB free; 10.26 MiB cached)

解决方法

我出现问题的代码,在输入到网络里面 ,如下:

output = net(input,inputcoord)

将这个代码修改成

withtorch.no_grad():

    output = net(input,inputcoord)

至于signal killed主要原因是OOM不够,也就是内存的空间不够。解决的方法就是把数据放在GPU上处理,这样可以大大减小系统内存的负荷。

input_img = input_img.cuda()

相关文章

网友评论

      本文标题:cuda run out of memory 和 signal

      本文链接:https://www.haomeiwen.com/subject/xlcinctx.html