赞
踩
跑模型时出现RuntimeError: CUDA out of memory.错误 查阅了许多相关内容,原因是:GPU显存内存不够
简单总结一下解决方法:
with torch.no_grad(): # 停止自动反向计算梯度
参考:
https://wisdomai.xyz/tool/pytorch/archives/2301
https://ptorch.com/news/160.html
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。