{
  "id": 598350,
  "title": "Submission for a predict function that takes more than 15 minutes to load the model.",
  "url": "/competitions/rsna-intracranial-aneurysm-detection/discussion/598350",
  "author_name": "NinjaNick",
  "post_date": "2025-08-10T08:23:16.727000",
  "votes": 0,
  "comment_count": 3,
  "views": 0,
  "content": "<p>So I've made the full script that I'm planning to submit but it took 7328.8 seconds to run because it makes and trains the model before doint the predict function so I always get the \"This notebook failed to connect to the inference server\" error. I might have solved it by loading a pretrained model, while still keeping the original training code, but I'm still waiting for my submission to go in.</p>\n<p>P.S. I'm also using the GPU T4 x2 accelerator and this is my first proper competition.</p>",
  "messages": [
    {
      "id": 3267506,
      "postDate": "2025-08-11T11:01:11.393Z",
      "content": "<p>Normally, you should be doing training in a separate Kaggle notebook (or external environment) and loading the trained model weights from a Kaggle dataset that you create.</p>\n<p>The competition host does not expect all your code to be in one place for this particular competition.</p>",
      "rawMarkdown": "Normally, you should be doing training in a separate Kaggle notebook (or external environment) and loading the trained model weights from a Kaggle dataset that you create.\n\nThe competition host does not expect all your code to be in one place for this particular competition."
    },
    {
      "id": 3267026,
      "postDate": "2025-08-10T08:29:06.143Z",
      "content": "<p>I am also unsure as to how I'm suposed to indicate in the predict function that it will take longer to load the model the original way.</p>",
      "rawMarkdown": "I am also unsure as to how I'm suposed to indicate in the predict function that it will take longer to load the model the original way.",
      "replies": [
        {
          "id": 3268138,
          "postDate": "2025-08-12T13:08:20.740Z",
          "content": "<p>Store a Global variable. Set it to false. When predict is called, load the model, then set the variable to True. This way the model only loads the first time predict is called.</p>",
          "rawMarkdown": "Store a Global variable. Set it to false. When predict is called, load the model, then set the variable to True. This way the model only loads the first time predict is called."
        }
      ]
    },
    {
      "id": 3267024,
      "postDate": "2025-08-10T08:23:16.727Z",
      "content": "<p>So I've made the full script that I'm planning to submit but it took 7328.8 seconds to run because it makes and trains the model before doint the predict function so I always get the \"This notebook failed to connect to the inference server\" error. I might have solved it by loading a pretrained model, while still keeping the original training code, but I'm still waiting for my submission to go in.</p>\n<p>P.S. I'm also using the GPU T4 x2 accelerator and this is my first proper competition.</p>",
      "rawMarkdown": "So I've made the full script that I'm planning to submit but it took 7328.8 seconds to run because it makes and trains the model before doint the predict function so I always get the \"This notebook failed to connect to the inference server\" error. I might have solved it by loading a pretrained model, while still keeping the original training code, but I'm still waiting for my submission to go in.\n\nP.S. I'm also using the GPU T4 x2 accelerator and this is my first proper competition."
    }
  ],
  "comments": [
    {
      "id": 3267506,
      "author_name": "coderRKJ",
      "author_url": "",
      "post_date": "2025-08-11T11:01:11.393000",
      "content": "<p>Normally, you should be doing training in a separate Kaggle notebook (or external environment) and loading the trained model weights from a Kaggle dataset that you create.</p>\n<p>The competition host does not expect all your code to be in one place for this particular competition.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3267026,
      "author_name": "NinjaNick",
      "author_url": "",
      "post_date": "2025-08-10T08:29:06.143000",
      "content": "<p>I am also unsure as to how I'm suposed to indicate in the predict function that it will take longer to load the model the original way.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3268138,
          "author_name": "jucious",
          "author_url": "",
          "post_date": "2025-08-12T13:08:20.740000",
          "content": "<p>Store a Global variable. Set it to false. When predict is called, load the model, then set the variable to True. This way the model only loads the first time predict is called.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3267506": "Normally, you should be doing training in a separate Kaggle notebook (or external environment) and loading the trained model weights from a Kaggle dataset that you create.\n\nThe competition host does not expect all your code to be in one place for this particular competition.",
    "3267026": "I am also unsure as to how I'm suposed to indicate in the predict function that it will take longer to load the model the original way.",
    "3267024": "So I've made the full script that I'm planning to submit but it took 7328.8 seconds to run because it makes and trains the model before doint the predict function so I always get the \"This notebook failed to connect to the inference server\" error. I might have solved it by loading a pretrained model, while still keeping the original training code, but I'm still waiting for my submission to go in.\n\nP.S. I'm also using the GPU T4 x2 accelerator and this is my first proper competition."
  }
}