{
  "id": 522924,
  "title": "What's the solution for the following problem? Any suggestions?",
  "url": "/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/522924",
  "author_name": "",
  "post_date": "2024-07-29T06:24:20.815053800Z",
  "votes": 3,
  "comment_count": 3,
  "views": 0,
  "content": "<p>OutOfMemoryError: CUDA out of memory. Tried to allocate 50.00 MiB. GPU 0 has a total capacty of 14.74 GiB of which 18.12 MiB is free. Process 2914 has 14.72 GiB memory in use. Of the allocated memory 14.37 GiB is allocated by PyTorch, and 232.08 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF</p>",
  "messages": [
    {
      "id": "2939429",
      "postDate": "07/29/2024 06:24:20",
      "content": "<p>OutOfMemoryError: CUDA out of memory. Tried to allocate 50.00 MiB. GPU 0 has a total capacty of 14.74 GiB of which 18.12 MiB is free. Process 2914 has 14.72 GiB memory in use. Of the allocated memory 14.37 GiB is allocated by PyTorch, and 232.08 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF</p>",
      "rawMarkdown": "OutOfMemoryError: CUDA out of memory. Tried to allocate 50.00 MiB. GPU 0 has a total capacty of 14.74 GiB of which 18.12 MiB is free. Process 2914 has 14.72 GiB memory in use. Of the allocated memory 14.37 GiB is allocated by PyTorch, and 232.08 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF",
      "votes": null
    },
    {
      "id": "2939430",
      "postDate": "07/29/2024 06:28:51",
      "content": "<p>This problem is due to:</p>\n<ol>\n<li>Large model size</li>\n<li>Large Batch size</li>\n<li>Memory leak over multiple iterations</li>\n</ol>\n<p>Without seeing your code all I can suggest is to reduce the batch size and, if this is inference code, use <code>with torch.no_grad():</code>.</p>",
      "rawMarkdown": "This problem is due to:\n1. Large model size\n2. Large Batch size\n3. Memory leak over multiple iterations\n\nWithout seeing your code all I can suggest is to reduce the batch size and, if this is inference code, use `with torch.no_grad():`.",
      "votes": null
    },
    {
      "id": "2939462",
      "postDate": "07/29/2024 07:14:57",
      "content": "<p>Thank you , let me try.</p>",
      "rawMarkdown": "Thank you , let me try.",
      "votes": null
    },
    {
      "id": "2939592",
      "postDate": "07/29/2024 10:27:37",
      "content": "<p>you can use memoisation technique or recursion.</p>",
      "rawMarkdown": "you can use memoisation technique or recursion.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2939430,
      "author_name": "coderrkj",
      "author_url": "",
      "post_date": "07/29/2024 06:28:51",
      "content": "<p>This problem is due to:</p>\n<ol>\n<li>Large model size</li>\n<li>Large Batch size</li>\n<li>Memory leak over multiple iterations</li>\n</ol>\n<p>Without seeing your code all I can suggest is to reduce the batch size and, if this is inference code, use <code>with torch.no_grad():</code>.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2939462,
          "author_name": "harjot4026",
          "author_url": "",
          "post_date": "07/29/2024 07:14:57",
          "content": "<p>Thank you , let me try.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2939592,
      "author_name": "",
      "author_url": "",
      "post_date": "07/29/2024 10:27:37",
      "content": "<p>you can use memoisation technique or recursion.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2939429": "OutOfMemoryError: CUDA out of memory. Tried to allocate 50.00 MiB. GPU 0 has a total capacty of 14.74 GiB of which 18.12 MiB is free. Process 2914 has 14.72 GiB memory in use. Of the allocated memory 14.37 GiB is allocated by PyTorch, and 232.08 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF",
    "2939430": "This problem is due to:\n1. Large model size\n2. Large Batch size\n3. Memory leak over multiple iterations\n\nWithout seeing your code all I can suggest is to reduce the batch size and, if this is inference code, use `with torch.no_grad():`.",
    "2939462": "Thank you , let me try.",
    "2939592": "you can use memoisation technique or recursion."
  },
  "source": "meta"
}