{
  "id": 234654,
  "title": "HPACellSegmentator: CUDA out of memory.",
  "url": "/competitions/hpa-single-cell-image-classification/discussion/234654",
  "author_name": "Shihao Shao",
  "post_date": "2021-04-25T12:49:32.192000",
  "votes": 2,
  "comment_count": 5,
  "views": 0,
  "content": "<p>It seems that HPACellSegmentator cost large GPU memory. It is easy for me to lead to OOM issue. For now, I find that use the weight from <a href=\"https://www.kaggle.com/rdizzl3\" target=\"_blank\">@rdizzl3</a> could help (thanks for your work!!!). Is there any way else that work?</p>",
  "messages": [
    {
      "id": 1287287,
      "postDate": "2021-04-28T21:52:56.820Z",
      "content": "<p>I tried many things. You can decrease 'scale factor' in the <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/tree/master/hpacellseg\" target=\"_blank\">CellSegmentator</a> but it does decrease the cell mask ability to some extent: .25 seems to be optimal. I am using a tweaked version of the label_cell function from <a href=\"https://www.kaggle.com/samusram/even-faster-hpa-cell-segmentation\" target=\"_blank\">https://www.kaggle.com/samusram/even-faster-hpa-cell-segmentation</a> in place of the imported package from <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/blob/master/hpacellseg/utils.py\" target=\"_blank\">CellSegmentator</a>.  I'll be interested to hear if others have ideas in this area.</p>",
      "rawMarkdown": "I tried many things. You can decrease 'scale factor' in the [CellSegmentator](https://github.com/CellProfiling/HPA-Cell-Segmentation/tree/master/hpacellseg) but it does decrease the cell mask ability to some extent: .25 seems to be optimal. I am using a tweaked version of the label_cell function from https://www.kaggle.com/samusram/even-faster-hpa-cell-segmentation in place of the imported package from [CellSegmentator](https://github.com/CellProfiling/HPA-Cell-Segmentation/blob/master/hpacellseg/utils.py).  I'll be interested to hear if others have ideas in this area.",
      "votes": 1
    },
    {
      "id": 1285653,
      "postDate": "2021-04-27T06:46:32.483Z",
      "content": "<p>Try using uint8 dtypes wherever possible , that reduces a huge memory overhead. I'm using batch size 8 for my inference notebooks , due to similar issues. CellSegmentator does use up lot of memory :/ If you use cell tile for inference ( I assume you do because you use segmentator) , load images , cast them to uint8 , segment , cast to float32 if needed.</p>",
      "rawMarkdown": "Try using uint8 dtypes wherever possible , that reduces a huge memory overhead. I'm using batch size 8 for my inference notebooks , due to similar issues. CellSegmentator does use up lot of memory :/ If you use cell tile for inference ( I assume you do because you use segmentator) , load images , cast them to uint8 , segment , cast to float32 if needed.",
      "votes": 2
    },
    {
      "id": 1284286,
      "postDate": "2021-04-25T18:57:29.987Z",
      "content": "<p>Use a smaller batch size? Could that help?</p>",
      "rawMarkdown": "Use a smaller batch size? Could that help?",
      "votes": 2,
      "replies": [
        {
          "id": 1284465,
          "postDate": "2021-04-26T00:32:27.857Z",
          "content": "<p>I'll try that. Thanks. But I just doubt about the time cost.</p>",
          "rawMarkdown": "I'll try that. Thanks. But I just doubt about the time cost.",
          "votes": 1
        },
        {
          "id": 1287639,
          "postDate": "2021-04-29T08:54:50.233Z",
          "content": "<p>Use an even smaller batch size. I agree</p>",
          "rawMarkdown": "Use an even smaller batch size. I agree"
        }
      ]
    },
    {
      "id": 1283960,
      "postDate": "2021-04-25T12:49:32.193Z",
      "content": "<p>It seems that HPACellSegmentator cost large GPU memory. It is easy for me to lead to OOM issue. For now, I find that use the weight from <a href=\"https://www.kaggle.com/rdizzl3\" target=\"_blank\">@rdizzl3</a> could help (thanks for your work!!!). Is there any way else that work?</p>",
      "rawMarkdown": "It seems that HPACellSegmentator cost large GPU memory. It is easy for me to lead to OOM issue. For now, I find that use the weight from @rdizzl3 could help (thanks for your work!!!). Is there any way else that work?",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 1287287,
      "author_name": "Amanda K Kimball",
      "author_url": "",
      "post_date": "2021-04-28T21:52:56.820000",
      "content": "<p>I tried many things. You can decrease 'scale factor' in the <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/tree/master/hpacellseg\" target=\"_blank\">CellSegmentator</a> but it does decrease the cell mask ability to some extent: .25 seems to be optimal. I am using a tweaked version of the label_cell function from <a href=\"https://www.kaggle.com/samusram/even-faster-hpa-cell-segmentation\" target=\"_blank\">https://www.kaggle.com/samusram/even-faster-hpa-cell-segmentation</a> in place of the imported package from <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/blob/master/hpacellseg/utils.py\" target=\"_blank\">CellSegmentator</a>.  I'll be interested to hear if others have ideas in this area.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1285653,
      "author_name": "Satwik",
      "author_url": "",
      "post_date": "2021-04-27T06:46:32.483000",
      "content": "<p>Try using uint8 dtypes wherever possible , that reduces a huge memory overhead. I'm using batch size 8 for my inference notebooks , due to similar issues. CellSegmentator does use up lot of memory :/ If you use cell tile for inference ( I assume you do because you use segmentator) , load images , cast them to uint8 , segment , cast to float32 if needed.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1284286,
      "author_name": "CroDoc",
      "author_url": "",
      "post_date": "2021-04-25T18:57:29.987000",
      "content": "<p>Use a smaller batch size? Could that help?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1284465,
          "author_name": "Shihao Shao",
          "author_url": "",
          "post_date": "2021-04-26T00:32:27.857000",
          "content": "<p>I'll try that. Thanks. But I just doubt about the time cost.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1287639,
          "author_name": "Marek Nurzynski",
          "author_url": "",
          "post_date": "2021-04-29T08:54:50.233000",
          "content": "<p>Use an even smaller batch size. I agree</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1287287": "I tried many things. You can decrease 'scale factor' in the [CellSegmentator](https://github.com/CellProfiling/HPA-Cell-Segmentation/tree/master/hpacellseg) but it does decrease the cell mask ability to some extent: .25 seems to be optimal. I am using a tweaked version of the label_cell function from https://www.kaggle.com/samusram/even-faster-hpa-cell-segmentation in place of the imported package from [CellSegmentator](https://github.com/CellProfiling/HPA-Cell-Segmentation/blob/master/hpacellseg/utils.py).  I'll be interested to hear if others have ideas in this area.",
    "1285653": "Try using uint8 dtypes wherever possible , that reduces a huge memory overhead. I'm using batch size 8 for my inference notebooks , due to similar issues. CellSegmentator does use up lot of memory :/ If you use cell tile for inference ( I assume you do because you use segmentator) , load images , cast them to uint8 , segment , cast to float32 if needed.",
    "1284286": "Use a smaller batch size? Could that help?",
    "1283960": "It seems that HPACellSegmentator cost large GPU memory. It is easy for me to lead to OOM issue. For now, I find that use the weight from @rdizzl3 could help (thanks for your work!!!). Is there any way else that work?"
  }
}