with torch.no_grad():
CUDA out of memory in pytorch
今天尝试了一下Transformer,一直遇到当validate若干次之后爆显存,一开始以为参数过多,batch size过大,但是无济于事。谷歌了相关内容,发现原来是需要加
with torch.no_grad():
torch.cuda.empty_cache()
这些效果都不明显
with torch.no_grad():
今天尝试了一下Transformer,一直遇到当validate若干次之后爆显存,一开始以为参数过多,batch size过大,但是无济于事。谷歌了相关内容,发现原来是需要加
with torch.no_grad():
torch.cuda.empty_cache()
这些效果都不明显