【问题标题】:Getting CUDA out of memory under pytorch in Google Colab在 Google Colab 的 pytorch 下使 CUDA 内存不足
【发布时间】:2020-03-21 19:34:20
【问题描述】:

我正在尝试在 google colab 中复制此处描述的工作 (https://www.analyticsvidhya.com/blog/2019/02/building-crowd-counting-model-python/)。不幸的是,起初它可以工作,但过了一段时间它显示这行代码的 cuda out of memory 错误。

output = model(img.unsqueeze(0))

这是错误描述:

RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 11.17 GiB total capacity; 10.78 GiB already allocated; 40.81 MiB free; 34.25 MiB cached)

我尝试在不同的谷歌帐户中运行此代码,但显示相同的错误。

【问题讨论】:

  • 现已解决。问题是图像的分辨率太高。所以我降低了图像分辨率,现在它可以正常工作了。
  • 您也可以通过降低批量大小而不是图像分辨率来解决问题 - 因为降低后者会影响分类精度
  • @MuhammadArslan 的评论可以作为答案。它有效。

标签: deep-learning computer-vision


【解决方案1】:

您也可以通过降低批量大小而不是图像分辨率来解决问题 - 因为降低后者会影响分类准确性

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-16
    • 2021-09-21
    • 1970-01-01
    • 1970-01-01
    • 2021-06-12
    • 2020-03-26
    • 1970-01-01
    • 2020-03-31
    相关资源
    最近更新 更多