{
  "id": 588865,
  "title": "Notebook Submission Issue: \"Inference Server Never Started\" Error",
  "url": "/competitions/cmi-detect-behavior-with-sensor-data/discussion/588865",
  "author_name": "",
  "post_date": "2025-07-08T18:31:43.981240600Z",
  "votes": 2,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi Guys,<br>\nI'm facing repeated issues while submitting my notebook to the <strong>CMI - Detect Behavior with Sensor Data competition.</strong> <br><br>\n<strong>Setup Summary:</strong></p>\n<ul>\n<li>Model training is done in Notebook A, saved as <code>.pkl</code> files (<code>binary_model.pkl</code>, <code>multiclass_model.pkl</code>, <code>label_encoder.pkl</code>)</li>\n<li>Final predictions and <code>submission.parquet</code> are generated in Notebook B, which only loads models, runs inference, and saves the file</li>\n<li>Dataset is properly linked, file format matches competition requirements (<code>sequence_id</code>, <code>binary_prediction</code>, <code>multiclass_prediction</code>)</li>\n<li>Notebook B contains no training code or heavy markdown, just model loading + prediction logic <br></li>\n</ul>\n<h2>Problem:</h2>\n<p>After clicking “Submit to Competition” from Notebook B, the modal shows <strong>Notebook Inference Server Never Started</strong> error. <br></p>\n<h4>Attempts Made:</h4>\n<ul>\n<li>Confirmed submission file structure</li>\n<li>Linked competition dataset correctly</li>\n<li>Cleaned notebook to keep only 3 cells (load models, predict, save)</li>\n<li>Tried submitting from within notebook and from competition page</li>\n<li>Tried with different versions and notebook refresh<br>\ni tried mostly every step of my side, but i am still somewhere wrong which is i don't know <br></li>\n</ul>\n<h4>Questions:</h4>\n<ul>\n<li>What exactly triggers this inference server error?</li>\n<li>Does notebook cell positioning or commit timing matter?</li>\n<li>Any best practices to prevent this issue during final submission?</li>\n<li>What should i have to do.? <br><br>\nWould appreciate any insights or debugging tips. <strong>Thanks in advance</strong>!</li>\n</ul>",
  "messages": [
    {
      "id": "3245014",
      "postDate": "07/08/2025 18:31:43",
      "content": "<p>Hi Guys,<br>\nI'm facing repeated issues while submitting my notebook to the <strong>CMI - Detect Behavior with Sensor Data competition.</strong> <br><br>\n<strong>Setup Summary:</strong></p>\n<ul>\n<li>Model training is done in Notebook A, saved as <code>.pkl</code> files (<code>binary_model.pkl</code>, <code>multiclass_model.pkl</code>, <code>label_encoder.pkl</code>)</li>\n<li>Final predictions and <code>submission.parquet</code> are generated in Notebook B, which only loads models, runs inference, and saves the file</li>\n<li>Dataset is properly linked, file format matches competition requirements (<code>sequence_id</code>, <code>binary_prediction</code>, <code>multiclass_prediction</code>)</li>\n<li>Notebook B contains no training code or heavy markdown, just model loading + prediction logic <br></li>\n</ul>\n<h2>Problem:</h2>\n<p>After clicking “Submit to Competition” from Notebook B, the modal shows <strong>Notebook Inference Server Never Started</strong> error. <br></p>\n<h4>Attempts Made:</h4>\n<ul>\n<li>Confirmed submission file structure</li>\n<li>Linked competition dataset correctly</li>\n<li>Cleaned notebook to keep only 3 cells (load models, predict, save)</li>\n<li>Tried submitting from within notebook and from competition page</li>\n<li>Tried with different versions and notebook refresh<br>\ni tried mostly every step of my side, but i am still somewhere wrong which is i don't know <br></li>\n</ul>\n<h4>Questions:</h4>\n<ul>\n<li>What exactly triggers this inference server error?</li>\n<li>Does notebook cell positioning or commit timing matter?</li>\n<li>Any best practices to prevent this issue during final submission?</li>\n<li>What should i have to do.? <br><br>\nWould appreciate any insights or debugging tips. <strong>Thanks in advance</strong>!</li>\n</ul>",
      "rawMarkdown": "Hi Guys,\n\nI'm facing repeated issues while submitting my notebook to the **CMI - Detect Behavior with Sensor Data competition.** <br>\n\n**Setup Summary:**\n- Model training is done in Notebook A, saved as `.pkl` files (`binary_model.pkl`, `multiclass_model.pkl`, `label_encoder.pkl`)\n- Final predictions and `submission.parquet` are generated in Notebook B, which only loads models, runs inference, and saves the file\n- Dataset is properly linked, file format matches competition requirements (`sequence_id`, `binary_prediction`, `multiclass_prediction`)\n- Notebook B contains no training code or heavy markdown, just model loading + prediction logic <br>\n\n## Problem:\nAfter clicking “Submit to Competition” from Notebook B, the modal shows **Notebook Inference Server Never Started** error. <br>\n\n#### Attempts Made:\n- Confirmed submission file structure\n- Linked competition dataset correctly\n- Cleaned notebook to keep only 3 cells (load models, predict, save)\n- Tried submitting from within notebook and from competition page\n- Tried with different versions and notebook refresh\ni tried mostly every step of my side, but i am still somewhere wrong which is i don't know <br>\n\n#### Questions:\n- What exactly triggers this inference server error?\n- Does notebook cell positioning or commit timing matter?\n- Any best practices to prevent this issue during final submission?\n- What should i have to do.? <br>\n\nWould appreciate any insights or debugging tips. **Thanks in advance**!",
      "votes": null
    },
    {
      "id": "3245350",
      "postDate": "07/09/2025 08:28:10",
      "content": "<p>i think you missed it<br>\n<code>import kaggle_evaluation.cmi_inference_server</code> </p>",
      "rawMarkdown": "i think you missed it\n`import kaggle_evaluation.cmi_inference_server`",
      "votes": null
    },
    {
      "id": "3245613",
      "postDate": "07/09/2025 15:31:56",
      "content": "<p>i ll try thanks dear</p>",
      "rawMarkdown": "i ll try thanks dear",
      "votes": null
    },
    {
      "id": "3245929",
      "postDate": "07/10/2025 04:07:05",
      "content": "<p>I imported at the beginning, but does not work. Do I need to do something else?</p>",
      "rawMarkdown": "I imported at the beginning, but does not work. Do I need to do something else?",
      "votes": null
    },
    {
      "id": "3246182",
      "postDate": "07/10/2025 14:07:50",
      "content": "<p><code>inference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)\nif not os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    inference_server.run_local_gateway(\n        data_paths=(\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv'\n        )\n    )\nelse:\n    inference_server.serve()</code></p>\n<p>see this competition is not like the others , this uses kaggles inference server .<br>\nwe ourselves should include <strong>calling</strong> the <strong>server</strong> as it is in the else block.<br>\nif it runs locally <strong>if</strong> block will execute. <br>\nand that server takes a function where we process the <strong>hidden test data</strong> and outputs the models <strong>predictions</strong> for that data in the <strong>correct format</strong> .<br>\nand this calling should be in the end after training the model, Cause we should make predictions right.</p>",
      "rawMarkdown": "`inference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)\nif not os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    inference_server.run_local_gateway(\n        data_paths=(\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv'\n        )\n    )\nelse:\n    inference_server.serve()`\n\nsee this competition is not like the others , this uses kaggles inference server .\nwe ourselves should include **calling** the **server** as it is in the else block.\nif it runs locally **if** block will execute. \nand that server takes a function where we process the **hidden test data** and outputs the models **predictions** for that data in the **correct format** .\nand this calling should be in the end after training the model, Cause we should make predictions right.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3245350,
      "author_name": "sivaprasadnaidu",
      "author_url": "",
      "post_date": "07/09/2025 08:28:10",
      "content": "<p>i think you missed it<br>\n<code>import kaggle_evaluation.cmi_inference_server</code> </p>",
      "votes": null,
      "replies": [
        {
          "id": 3245613,
          "author_name": "abdulrehmanchatha",
          "author_url": "",
          "post_date": "07/09/2025 15:31:56",
          "content": "<p>i ll try thanks dear</p>",
          "votes": null,
          "replies": [
            {
              "id": 3245929,
              "author_name": "backpack30",
              "author_url": "",
              "post_date": "07/10/2025 04:07:05",
              "content": "<p>I imported at the beginning, but does not work. Do I need to do something else?</p>",
              "votes": null,
              "replies": [
                {
                  "id": 3246182,
                  "author_name": "sivaprasadnaidu",
                  "author_url": "",
                  "post_date": "07/10/2025 14:07:50",
                  "content": "<p><code>inference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)\nif not os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    inference_server.run_local_gateway(\n        data_paths=(\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv'\n        )\n    )\nelse:\n    inference_server.serve()</code></p>\n<p>see this competition is not like the others , this uses kaggles inference server .<br>\nwe ourselves should include <strong>calling</strong> the <strong>server</strong> as it is in the else block.<br>\nif it runs locally <strong>if</strong> block will execute. <br>\nand that server takes a function where we process the <strong>hidden test data</strong> and outputs the models <strong>predictions</strong> for that data in the <strong>correct format</strong> .<br>\nand this calling should be in the end after training the model, Cause we should make predictions right.</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3245014": "Hi Guys,\n\nI'm facing repeated issues while submitting my notebook to the **CMI - Detect Behavior with Sensor Data competition.** <br>\n\n**Setup Summary:**\n- Model training is done in Notebook A, saved as `.pkl` files (`binary_model.pkl`, `multiclass_model.pkl`, `label_encoder.pkl`)\n- Final predictions and `submission.parquet` are generated in Notebook B, which only loads models, runs inference, and saves the file\n- Dataset is properly linked, file format matches competition requirements (`sequence_id`, `binary_prediction`, `multiclass_prediction`)\n- Notebook B contains no training code or heavy markdown, just model loading + prediction logic <br>\n\n## Problem:\nAfter clicking “Submit to Competition” from Notebook B, the modal shows **Notebook Inference Server Never Started** error. <br>\n\n#### Attempts Made:\n- Confirmed submission file structure\n- Linked competition dataset correctly\n- Cleaned notebook to keep only 3 cells (load models, predict, save)\n- Tried submitting from within notebook and from competition page\n- Tried with different versions and notebook refresh\ni tried mostly every step of my side, but i am still somewhere wrong which is i don't know <br>\n\n#### Questions:\n- What exactly triggers this inference server error?\n- Does notebook cell positioning or commit timing matter?\n- Any best practices to prevent this issue during final submission?\n- What should i have to do.? <br>\n\nWould appreciate any insights or debugging tips. **Thanks in advance**!",
    "3245350": "i think you missed it\n`import kaggle_evaluation.cmi_inference_server`",
    "3245613": "i ll try thanks dear",
    "3245929": "I imported at the beginning, but does not work. Do I need to do something else?",
    "3246182": "`inference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)\nif not os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    inference_server.run_local_gateway(\n        data_paths=(\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv'\n        )\n    )\nelse:\n    inference_server.serve()`\n\nsee this competition is not like the others , this uses kaggles inference server .\nwe ourselves should include **calling** the **server** as it is in the else block.\nif it runs locally **if** block will execute. \nand that server takes a function where we process the **hidden test data** and outputs the models **predictions** for that data in the **correct format** .\nand this calling should be in the end after training the model, Cause we should make predictions right."
  },
  "source": "meta"
}