报错记录torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 90.00 MiB (GPU 0; 7.93 GiB to

这篇具有很好参考价值的文章主要介绍了报错记录torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 90.00 MiB (GPU 0; 7.93 GiB to。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 90.00 MiB (GPU 0; 7.93 GiB total capacity; 758.34 MiB already allocated; 5.75 MiB free; 858.00 MiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

原因,我选的卡号选错了,

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"

确认好两件事:
1、本地文件和远程文件同步好了
2、代码中有没有指定哪块GPU的操作
他这个报错很反直觉的一个地方:如果你指定了2卡,2卡显存满了,他会说0卡显存满了,你去看0发现0根本没人用,这就很容易被绕进去文章来源地址https://www.toymoban.com/news/detail-524069.html

到了这里,关于报错记录torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 90.00 MiB (GPU 0; 7.93 GiB to的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Ubuntu下跑Aplaca报错:torch.cuda.0utofMemoryError: CUDA out of memory.解决办法(查看CUDA占用情况&清除GPU缓存)

    错误提示: torch.cuda.0utofMemoryError: CUDA out of memory.Tried to allocate 2.00 MiB (PU 0; 23.69 GiB total capacity; 237 BiB already allocated; 18.38 MiB fre; 2.50 GiB reserved in total by PyTorch) If reserved memory is allocated memory try setting max_split_size_mb to avoid fragmentation.See documentation for Memory Management and PYTORCH_CUDA_ALLOC_

    2024年02月11日
    浏览(37)
  • CUDA报错:Out of Memory

    如果报错里提示Pytorch reserved的内存远大于Already allocated的内存,那么就是因为分配显存时单位过大,导致出现大量内存碎片无法继续分配(与操作系统内存管理同理)。 我们可以限制一次分配的最大单位来解决这个问题。 随后代码便可正常运行了。

    2024年02月15日
    浏览(48)
  • 报错解决:RuntimeError: CUDA out of memory.

    在进行深度学习的模型训练时,经常会遇到显存溢出的报错: RuntimeError: CUDA out of memory. 输出如下图所示: 打开一个终端,输入以下命令查看GPU使用情况: 输出如下图所示: 使用nvidia-htop可以进一步查看更为详细的内容。 nvidia-htop:A tool for enriching the output of nvidia-smi. 可以通

    2024年02月12日
    浏览(40)
  • 【Debug记录】CUDA out of memory.|显存不足|xx GiB reserved in total by PyTorch

    报错原因: “运行时错误:CUDA内存不足。尝试分配2.00 GiB(GPU 0;总容量10.76 GiB;已分配7.67 GiB;1.73 GiB可用;PyTorch总共保留8.20 GiB)“ 报错原因: 显存不足。(只是导入一个三维图像,使用unet模型,batchsize为1,numworks为0,在训练每个epoch后释放缓存torch.cuda.empty_cache(),验证

    2024年02月16日
    浏览(26)
  • 【CUDA OUT OF MEMORY】【Pytorch】计算图与CUDA OOM

    在实践过程中多次碰到了CUDA OOM的问题,有时候这个问题是很好解决的,有时候DEBUG一整天还是头皮发麻。 最近实践对由于计算图积累导致CUDA OOM有一点新的看法,写下来记录一下。 包括对计算图的一些看法和一个由于计算图引发错误的简化实例记录。 本人能力有限,认识片

    2024年02月09日
    浏览(27)
  • RuntimeError: CUDA out of memory See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

    报错: If reserved memory is allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF 当reserved memory is allocated memory,进行如下设置,可解决此bug: 代码如下:

    2024年02月11日
    浏览(39)
  • 【已解决】探究CUDA out of memory背后原因,如何释放GPU显存?

    研究过深度学习的同学,一定对类似下面这个CUDA显存溢出错误不陌生 RuntimeError: CUDA out of memory. Tried to allocate 916.00 MiB (GPU 0; 6.00 GiB total capacity; 4.47 GiB already allocated; 186.44 MiB free; 4.47 GiB reserved in total by PyTorch) 本文探究CUDA的内存管理机制,并总结该问题的解决办法 在实验开始前

    2023年04月20日
    浏览(87)
  • RuntimeError: CUDA out of memory.【多种场景下的解决方案】

    RuntimeError: CUDA out of memory.【多种场景下的解决方案】 🌈 个人主页:高斯小哥 🔥 高质量专栏:【Matplotlib之旅:零基础精通数据可视化】 🏆🏆关注博主,随时获取更多关于深度学习、PyTorch、Python领域的优质内容!🏆🏆   随着深度学习的繁荣发展,GPU已成为推动这一浪

    2024年02月22日
    浏览(36)
  • Stable Diffusion WebUI内存不够爆CUDA Out of memory怎么办?

    在我们运行SD的时候,我们经常会爆CUDA Out of memory。 我们应该怎么办呢? 这是因为我们的显存或者内存不够了。 如果你是用cpu来跑图的则表示内存不够,这个时候就需要换个大点的内存了。 如果你是用gpu来跑图的就说明你显存不够用咯,这时候咋办呢? 下面我将一一述说解

    2024年02月08日
    浏览(107)
  • 【PyTorch】设置CUDA_VISIBLE_DEVICES无效的问题以及多卡使用以及CUDA out of memory问题

    方法1: 理想情况下, 该环境变量应设置在程序的顶部 。如果在设置 torch.backends.cudnn.benchmark 之后调用 CUDA_VISIBLE_DEVICES 变量,则更改 CUDA_VISIBLE_DEVICES 变量将不起作用。 方法2: https://discuss.pytorch.org/t/how-to-change-the-default-device-of-gpu-device-ids-0/1041/29 问题:单机多卡使用时,指定

    2024年04月14日
    浏览(37)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包