{
  "id": 272207,
  "title": "GPU memory shoots up when loading a pretrained model",
  "url": "/competitions/siim-covid19-detection/discussion/272207",
  "author_name": "Alfred K J",
  "post_date": "2021-09-14T15:02:41.498000",
  "votes": 0,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I have uploaded pre-trained weights of a stacked EfficientNetB7 model in my private dataset. While loading these weights in my submission notebook, I have observed that the GPU memory shoots up from 0 bytes to 15 GB. I am suspecting this is causing my notebook to cause a \"notebook Exceeded Allowed Compute\" error on submission.</p>\n<p>Can anyone suggest what can I do to free the GPU memory?<br>\nI have tried deleting the model variable and other variables after use. I have also tried commands like: gc.collect(); torch.cuda.empty_cache()</p>",
  "messages": [
    {
      "id": 1512778,
      "postDate": "2021-09-14T15:02:41.497Z",
      "content": "<p>I have uploaded pre-trained weights of a stacked EfficientNetB7 model in my private dataset. While loading these weights in my submission notebook, I have observed that the GPU memory shoots up from 0 bytes to 15 GB. I am suspecting this is causing my notebook to cause a \"notebook Exceeded Allowed Compute\" error on submission.</p>\n<p>Can anyone suggest what can I do to free the GPU memory?<br>\nI have tried deleting the model variable and other variables after use. I have also tried commands like: gc.collect(); torch.cuda.empty_cache()</p>",
      "rawMarkdown": "I have uploaded pre-trained weights of a stacked EfficientNetB7 model in my private dataset. While loading these weights in my submission notebook, I have observed that the GPU memory shoots up from 0 bytes to 15 GB. I am suspecting this is causing my notebook to cause a \"notebook Exceeded Allowed Compute\" error on submission.\n\nCan anyone suggest what can I do to free the GPU memory?\nI have tried deleting the model variable and other variables after use. I have also tried commands like: gc.collect(); torch.cuda.empty_cache()"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1512778": "I have uploaded pre-trained weights of a stacked EfficientNetB7 model in my private dataset. While loading these weights in my submission notebook, I have observed that the GPU memory shoots up from 0 bytes to 15 GB. I am suspecting this is causing my notebook to cause a \"notebook Exceeded Allowed Compute\" error on submission.\n\nCan anyone suggest what can I do to free the GPU memory?\nI have tried deleting the model variable and other variables after use. I have also tried commands like: gc.collect(); torch.cuda.empty_cache()"
  }
}