{
  "id": 671984,
  "title": "Notebook Time Limit Exceeded Error",
  "url": "/competitions/vesuvius-challenge-surface-detection/discussion/671984",
  "author_name": "",
  "post_date": "2026-02-05T09:56:53.391661Z",
  "votes": -2,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Hi everyone,\nI am facing a Time Limit Exceeded (TLE) error on submission and trying to figure out if my inference strategy is fundamentally too slow or if I have a specific implementation bug.\nMy notebook runs for around 1-1.5 hrs on GPU P100. But after submitting it, I get a notebook Time limit exceeded error after being run for 10 hrs.\nMy Approach:\nModel: Standard 2D U-Net.\nInput: I am using a \"2.5D\" approach, taking 5 slices as input (current slice +/- 2 neighbors).\nResolution: During inference, I resize the input stack to 256x256 before feeding it to the model, then resize the prediction back to the original volume size.\nMy Inference Loop: Currently, I am iterating through the z-axis of the volume one slice at a time.\nFor every z, I load the 5 necessary slices from the .tif file.\nI resize them, normalize, and convert to tensor.\nI run the model (Batch size = 1).\nI resize the output mask and save it to a numpy array.\nThe Issue: This runs locally on sample data, but times out on the hidden test set.\nQuestions:</p>\n<ol>\n<li>Is processing the volume slice-by-slice (Batch size 1) generally too slow for this competition's hidden test set size?</li>\n<li>Do I need to load the entire volume into RAM at once instead of reading from disk for every slice?\nWhat I feel is that inside my inference loop, I am opening a big TIFF file inside the loop for every single slice and that might be causing a huge overhead.\nfor z in range(pad, d - pad):\nwith Image.open(p) as img:<br>\n   stack = []\n   for k in range(z-pad, z+pad+1):\n       img.seek(k)\n       stack.append(np.array(img))\nThanks for any suggestions.</li>\n</ol>",
  "messages": [
    {
      "id": "3402136",
      "postDate": "02/05/2026 09:56:53",
      "content": "<p>Hi everyone,\nI am facing a Time Limit Exceeded (TLE) error on submission and trying to figure out if my inference strategy is fundamentally too slow or if I have a specific implementation bug.\nMy notebook runs for around 1-1.5 hrs on GPU P100. But after submitting it, I get a notebook Time limit exceeded error after being run for 10 hrs.\nMy Approach:\nModel: Standard 2D U-Net.\nInput: I am using a \"2.5D\" approach, taking 5 slices as input (current slice +/- 2 neighbors).\nResolution: During inference, I resize the input stack to 256x256 before feeding it to the model, then resize the prediction back to the original volume size.\nMy Inference Loop: Currently, I am iterating through the z-axis of the volume one slice at a time.\nFor every z, I load the 5 necessary slices from the .tif file.\nI resize them, normalize, and convert to tensor.\nI run the model (Batch size = 1).\nI resize the output mask and save it to a numpy array.\nThe Issue: This runs locally on sample data, but times out on the hidden test set.\nQuestions:</p>\n<ol>\n<li>Is processing the volume slice-by-slice (Batch size 1) generally too slow for this competition's hidden test set size?</li>\n<li>Do I need to load the entire volume into RAM at once instead of reading from disk for every slice?\nWhat I feel is that inside my inference loop, I am opening a big TIFF file inside the loop for every single slice and that might be causing a huge overhead.\nfor z in range(pad, d - pad):\nwith Image.open(p) as img:<br>\n   stack = []\n   for k in range(z-pad, z+pad+1):\n       img.seek(k)\n       stack.append(np.array(img))\nThanks for any suggestions.</li>\n</ol>",
      "rawMarkdown": "Hi everyone,\n\nI am facing a Time Limit Exceeded (TLE) error on submission and trying to figure out if my inference strategy is fundamentally too slow or if I have a specific implementation bug.\n\nMy notebook runs for around 1-1.5 hrs on GPU P100. But after submitting it, I get a notebook Time limit exceeded error after being run for 10 hrs.\n\nMy Approach:\n\nModel: Standard 2D U-Net.\n\nInput: I am using a \"2.5D\" approach, taking 5 slices as input (current slice +/- 2 neighbors).\n\nResolution: During inference, I resize the input stack to 256x256 before feeding it to the model, then resize the prediction back to the original volume size.\n\nMy Inference Loop: Currently, I am iterating through the z-axis of the volume one slice at a time.\n\nFor every z, I load the 5 necessary slices from the .tif file.\n\nI resize them, normalize, and convert to tensor.\n\nI run the model (Batch size = 1).\n\nI resize the output mask and save it to a numpy array.\n\nThe Issue: This runs locally on sample data, but times out on the hidden test set.\n\nQuestions:\n\n1. Is processing the volume slice-by-slice (Batch size 1) generally too slow for this competition's hidden test set size?\n\n2. Do I need to load the entire volume into RAM at once instead of reading from disk for every slice?\n\n\nWhat I feel is that inside my inference loop, I am opening a big TIFF file inside the loop for every single slice and that might be causing a huge overhead.\n\nfor z in range(pad, d - pad):\n    with Image.open(p) as img:  \n        stack = []\n        for k in range(z-pad, z+pad+1):\n            img.seek(k)\n            stack.append(np.array(img))\n\n\nThanks for any suggestions.",
      "votes": null
    },
    {
      "id": "3402156",
      "postDate": "02/05/2026 11:08:25",
      "content": "<p>My notebook runs for around 1-1.5 hrs on GPU P100\nis this training or inference after submitting for competetion?</p>",
      "rawMarkdown": "My notebook runs for around 1-1.5 hrs on GPU P100\nis this training or inference after submitting for competetion?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3402156,
      "author_name": "arjunashokbhandary",
      "author_url": "",
      "post_date": "02/05/2026 11:08:25",
      "content": "<p>My notebook runs for around 1-1.5 hrs on GPU P100\nis this training or inference after submitting for competetion?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3402136": "Hi everyone,\n\nI am facing a Time Limit Exceeded (TLE) error on submission and trying to figure out if my inference strategy is fundamentally too slow or if I have a specific implementation bug.\n\nMy notebook runs for around 1-1.5 hrs on GPU P100. But after submitting it, I get a notebook Time limit exceeded error after being run for 10 hrs.\n\nMy Approach:\n\nModel: Standard 2D U-Net.\n\nInput: I am using a \"2.5D\" approach, taking 5 slices as input (current slice +/- 2 neighbors).\n\nResolution: During inference, I resize the input stack to 256x256 before feeding it to the model, then resize the prediction back to the original volume size.\n\nMy Inference Loop: Currently, I am iterating through the z-axis of the volume one slice at a time.\n\nFor every z, I load the 5 necessary slices from the .tif file.\n\nI resize them, normalize, and convert to tensor.\n\nI run the model (Batch size = 1).\n\nI resize the output mask and save it to a numpy array.\n\nThe Issue: This runs locally on sample data, but times out on the hidden test set.\n\nQuestions:\n\n1. Is processing the volume slice-by-slice (Batch size 1) generally too slow for this competition's hidden test set size?\n\n2. Do I need to load the entire volume into RAM at once instead of reading from disk for every slice?\n\n\nWhat I feel is that inside my inference loop, I am opening a big TIFF file inside the loop for every single slice and that might be causing a huge overhead.\n\nfor z in range(pad, d - pad):\n    with Image.open(p) as img:  \n        stack = []\n        for k in range(z-pad, z+pad+1):\n            img.seek(k)\n            stack.append(np.array(img))\n\n\nThanks for any suggestions.",
    "3402156": "My notebook runs for around 1-1.5 hrs on GPU P100\nis this training or inference after submitting for competetion?"
  },
  "source": "meta"
}