pytorch CUDA out of memor

穿精又带淫゛_ 提交于 2020-08-04 16:27:39

 

pytorch CUDA out of memor

 

解决方法:

用完把cuda变量 del

显存能增大一倍

    import time
    net = BiSeNet()
    net.cuda()
    net.eval()
    in_ten = torch.randn(8, 3, 640, 640).cuda()

    for i in range(8):
        start=time.time()
        out, out16, out32 = net(in_ten)
        print(time.time()-start,out.shape,out16.shape,out32.shape)
        del out
        del out16
        del out32

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!