{
  "id": 463580,
  "title": "is there any universe stategy to speed up inference?I got run time over 12h error.please help me",
  "url": "/competitions/UBC-OCEAN/discussion/463580",
  "author_name": "Toby",
  "post_date": "2023-12-26T01:34:34.950000",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>is there any universe stategy to speed up inference?I got run time over 12h error.please help me</p>",
  "messages": [
    {
      "id": 2574465,
      "postDate": "2023-12-26T01:34:34.950Z",
      "content": "<p>is there any universe stategy to speed up inference?I got run time over 12h error.please help me</p>",
      "rawMarkdown": "is there any universe stategy to speed up inference?I got run time over 12h error.please help me",
      "votes": 1
    },
    {
      "id": 2584017,
      "postDate": "2024-01-02T16:28:13.747Z",
      "content": "<p>I will be sharing my code that patches and does inference on every data sample in the dataset shortly but I recommend using pyvips GPU and python-openslide to efficiently work with these images.</p>",
      "rawMarkdown": "I will be sharing my code that patches and does inference on every data sample in the dataset shortly but I recommend using pyvips GPU and python-openslide to efficiently work with these images."
    },
    {
      "id": 2577446,
      "postDate": "2023-12-28T15:58:09.783Z",
      "content": "<p>Hi, yes you can use onnx/tensorrt/openvino.</p>\n<p>Good luck!</p>",
      "rawMarkdown": "Hi, yes you can use onnx/tensorrt/openvino.\n\nGood luck!"
    },
    {
      "id": 2576056,
      "postDate": "2023-12-27T13:04:36.520Z",
      "content": "<p>I asked a similar question: <a href=\"https://www.kaggle.com/competitions/UBC-OCEAN/discussion/463328\" target=\"_blank\">https://www.kaggle.com/competitions/UBC-OCEAN/discussion/463328</a></p>\n<p><a href=\"https://www.kaggle.com/aliabbasi\" target=\"_blank\">@aliabbasi</a> was kind enough to point me in the direction of multiprocessing.</p>\n<p>I've tried splitting the tile generation up into workers that convert the tiles generated with pyvips to numpy (seems to be the slow step, the cropping actually happens fast until you transform the pyvips image). I've also split the entire workflow up where I have 4 processes running simultaneously to crop, convert to numpy, and run inference. Both seem to work well, though the latter has some trouble with memory issues if your NN has many parameters and you want to look at a lot of tiles.</p>",
      "rawMarkdown": "I asked a similar question: https://www.kaggle.com/competitions/UBC-OCEAN/discussion/463328\n\n@aliabbasi was kind enough to point me in the direction of multiprocessing.\n\nI've tried splitting the tile generation up into workers that convert the tiles generated with pyvips to numpy (seems to be the slow step, the cropping actually happens fast until you transform the pyvips image). I've also split the entire workflow up where I have 4 processes running simultaneously to crop, convert to numpy, and run inference. Both seem to work well, though the latter has some trouble with memory issues if your NN has many parameters and you want to look at a lot of tiles."
    },
    {
      "id": 2575244,
      "postDate": "2023-12-26T17:54:43.807Z",
      "content": "<p>Hi!<br>\nYou said that you are receiving a runtime error, I assume you are making predictions using images at full resolution. If you are reading the images sequentially, just the image reading part can take as long as 9-10 hours. You can reduce the image reading time by using multiprocessing to read multiple photos at the same time.</p>",
      "rawMarkdown": "Hi!\nYou said that you are receiving a runtime error, I assume you are making predictions using images at full resolution. If you are reading the images sequentially, just the image reading part can take as long as 9-10 hours. You can reduce the image reading time by using multiprocessing to read multiple photos at the same time."
    }
  ],
  "comments": [
    {
      "id": 2584017,
      "author_name": "Connor",
      "author_url": "",
      "post_date": "2024-01-02T16:28:13.747000",
      "content": "<p>I will be sharing my code that patches and does inference on every data sample in the dataset shortly but I recommend using pyvips GPU and python-openslide to efficiently work with these images.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2577446,
      "author_name": "Pablo Larrosa",
      "author_url": "",
      "post_date": "2023-12-28T15:58:09.783000",
      "content": "<p>Hi, yes you can use onnx/tensorrt/openvino.</p>\n<p>Good luck!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2576056,
      "author_name": "chemdatafarmer",
      "author_url": "",
      "post_date": "2023-12-27T13:04:36.520000",
      "content": "<p>I asked a similar question: <a href=\"https://www.kaggle.com/competitions/UBC-OCEAN/discussion/463328\" target=\"_blank\">https://www.kaggle.com/competitions/UBC-OCEAN/discussion/463328</a></p>\n<p><a href=\"https://www.kaggle.com/aliabbasi\" target=\"_blank\">@aliabbasi</a> was kind enough to point me in the direction of multiprocessing.</p>\n<p>I've tried splitting the tile generation up into workers that convert the tiles generated with pyvips to numpy (seems to be the slow step, the cropping actually happens fast until you transform the pyvips image). I've also split the entire workflow up where I have 4 processes running simultaneously to crop, convert to numpy, and run inference. Both seem to work well, though the latter has some trouble with memory issues if your NN has many parameters and you want to look at a lot of tiles.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2575244,
      "author_name": "turkenm",
      "author_url": "",
      "post_date": "2023-12-26T17:54:43.807000",
      "content": "<p>Hi!<br>\nYou said that you are receiving a runtime error, I assume you are making predictions using images at full resolution. If you are reading the images sequentially, just the image reading part can take as long as 9-10 hours. You can reduce the image reading time by using multiprocessing to read multiple photos at the same time.</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2574465": "is there any universe stategy to speed up inference?I got run time over 12h error.please help me",
    "2584017": "I will be sharing my code that patches and does inference on every data sample in the dataset shortly but I recommend using pyvips GPU and python-openslide to efficiently work with these images.",
    "2577446": "Hi, yes you can use onnx/tensorrt/openvino.\n\nGood luck!",
    "2576056": "I asked a similar question: https://www.kaggle.com/competitions/UBC-OCEAN/discussion/463328\n\n@aliabbasi was kind enough to point me in the direction of multiprocessing.\n\nI've tried splitting the tile generation up into workers that convert the tiles generated with pyvips to numpy (seems to be the slow step, the cropping actually happens fast until you transform the pyvips image). I've also split the entire workflow up where I have 4 processes running simultaneously to crop, convert to numpy, and run inference. Both seem to work well, though the latter has some trouble with memory issues if your NN has many parameters and you want to look at a lot of tiles.",
    "2575244": "Hi!\nYou said that you are receiving a runtime error, I assume you are making predictions using images at full resolution. If you are reading the images sequentially, just the image reading part can take as long as 9-10 hours. You can reduce the image reading time by using multiprocessing to read multiple photos at the same time."
  }
}