{
  "id": 591430,
  "title": "[Solve] Notebook Inference Server Never Started: even though debug using train.csv is successful",
  "url": "/competitions/cmi-detect-behavior-with-sensor-data/discussion/591430",
  "author_name": "",
  "post_date": "2025-07-28T05:09:10.612971700Z",
  "votes": null,
  "comment_count": 7,
  "views": 0,
  "content": "<p>I ran my inference notebook. The last cell is below.</p>\n<pre><code>inference_server = kaggle_evaluation(predict)\n\n os():\n    inference_server()\n:\n    inference_server(\n        data_paths=(\n            ,\n            ,\n        )\n    )\n</code></pre>\n<p>The running was successful within 1 hour, but when submitting, \"Notebook Inference Server Never Started\" error occured in a few minutes.<br>\nWhat is the reason of this? Has anyone faced this issue?</p>",
  "messages": [
    {
      "id": "3255159",
      "postDate": "07/28/2025 05:09:10",
      "content": "<p>I ran my inference notebook. The last cell is below.</p>\n<pre><code>inference_server = kaggle_evaluation(predict)\n\n os():\n    inference_server()\n:\n    inference_server(\n        data_paths=(\n            ,\n            ,\n        )\n    )\n</code></pre>\n<p>The running was successful within 1 hour, but when submitting, \"Notebook Inference Server Never Started\" error occured in a few minutes.<br>\nWhat is the reason of this? Has anyone faced this issue?</p>",
      "rawMarkdown": "I ran my inference notebook. The last cell is below.\n\n```\ninference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)\n\nif os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    inference_server.serve()\nelse:\n    inference_server.run_local_gateway(\n        data_paths=(\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/train.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/train_demographics.csv',\n        )\n    )\n```\n\nThe running was successful within 1 hour, but when submitting, \"Notebook Inference Server Never Started\" error occured in a few minutes.\nWhat is the reason of this? Has anyone faced this issue?",
      "votes": null
    },
    {
      "id": "3255200",
      "postDate": "07/28/2025 07:24:22",
      "content": "<p>if the notebook  took more than 15 mins before the  predict function start it will raise this error, so make a new notebook for direct inference</p>",
      "rawMarkdown": "if the notebook  took more than 15 mins before the  predict function start it will raise this error, so make a new notebook for direct inference",
      "votes": null
    },
    {
      "id": "3255207",
      "postDate": "07/28/2025 07:34:38",
      "content": "<p>Thanks for answering, but the error occured about 2 min. after submitting. So it was weird…</p>",
      "rawMarkdown": "Thanks for answering, but the error occured about 2 min. after submitting. So it was weird...",
      "votes": null
    },
    {
      "id": "3255244",
      "postDate": "07/28/2025 09:24:22",
      "content": "<p>I managed to solve the issue. My Kaggle package dependency manager was not worked somehow. I have just changed importing from notebooks.</p>",
      "rawMarkdown": "I managed to solve the issue. My Kaggle package dependency manager was not worked somehow. I have just changed importing from notebooks.",
      "votes": null
    },
    {
      "id": "3255410",
      "postDate": "07/28/2025 15:54:09",
      "content": "<p>I faced a similar issue before. In many cases, the problem is that while the local run (run_local_gateway) works fine, the serve() function fails silently during submission.</p>\n<p>A few things to check:</p>\n<p>Make sure your notebook is committed, not just debug-run.</p>\n<p>Load the model inside the predict function, or at least lazy-load it to avoid long startup delays.</p>\n<p>Check that all required files (like model weights) are added to the input section of the notebook.</p>\n<p>Add print() statements to trace what’s happening during serve() — these show up in the logs.</p>\n<p>You can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.</p>\n<p>Also, check the logs after submission — they often reveal silent errors or timeouts during server startup.</p>\n<p>Let me know if you want help reviewing the code or setup.</p>",
      "rawMarkdown": "I faced a similar issue before. In many cases, the problem is that while the local run (run_local_gateway) works fine, the serve() function fails silently during submission.\n\nA few things to check:\n\nMake sure your notebook is committed, not just debug-run.\n\nLoad the model inside the predict function, or at least lazy-load it to avoid long startup delays.\n\nCheck that all required files (like model weights) are added to the input section of the notebook.\n\nAdd print() statements to trace what’s happening during serve() — these show up in the logs.\n\nYou can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.\n\nAlso, check the logs after submission — they often reveal silent errors or timeouts during server startup.\n\nLet me know if you want help reviewing the code or setup.",
      "votes": null
    },
    {
      "id": "3265116",
      "postDate": "08/07/2025 03:43:00",
      "content": "<blockquote>\n  <p>You can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.</p>\n</blockquote>\n<p>After a while I understood, I should have done this at first..</p>\n<p>Thanks for the tip.</p>",
      "rawMarkdown": ">You can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.\n\nAfter a while I understood, I should have done this at first..\n\nThanks for the tip.",
      "votes": null
    },
    {
      "id": "3269132",
      "postDate": "08/14/2025 01:37:42",
      "content": "<p>strangely I have also started getting this Notebook Inference Server Never Started</p>",
      "rawMarkdown": "strangely I have also started getting this Notebook Inference Server Never Started",
      "votes": null
    },
    {
      "id": "3272449",
      "postDate": "08/21/2025 01:25:52",
      "content": "<p>Notebook Inference Server Error<br>\nYour submission notebook did not register the expected endpoint to your inference server.</p>\n<p>How to solve Gateway Runtime Error?</p>\n<pre><code>\nGatewayRuntimeError                       Traceback (most recent call )\n/tmp/ipykernel_36/py  &lt;cell : &gt;()\n           inference_server.serve()\n       :\n\n               data_paths=(\n                   ,\n</code></pre>",
      "rawMarkdown": "Notebook Inference Server Error\nYour submission notebook did not register the expected endpoint to your inference server.\n\nHow to solve Gateway Runtime Error?\n```\n---------------------------------------------------------------------------\nGatewayRuntimeError                       Traceback (most recent call last)\n/tmp/ipykernel_36/1232577806.py in <cell line: 0>()\n      5     inference_server.serve()\n      6 else:\n----> 7     inference_server.run_local_gateway(\n      8         data_paths=(\n      9             '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3255200,
      "author_name": "tahaalshatiri",
      "author_url": "",
      "post_date": "07/28/2025 07:24:22",
      "content": "<p>if the notebook  took more than 15 mins before the  predict function start it will raise this error, so make a new notebook for direct inference</p>",
      "votes": null,
      "replies": [
        {
          "id": 3255207,
          "author_name": "shigeria",
          "author_url": "",
          "post_date": "07/28/2025 07:34:38",
          "content": "<p>Thanks for answering, but the error occured about 2 min. after submitting. So it was weird…</p>",
          "votes": null,
          "replies": [
            {
              "id": 3269132,
              "author_name": "gauravbrills",
              "author_url": "",
              "post_date": "08/14/2025 01:37:42",
              "content": "<p>strangely I have also started getting this Notebook Inference Server Never Started</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3255244,
      "author_name": "shigeria",
      "author_url": "",
      "post_date": "07/28/2025 09:24:22",
      "content": "<p>I managed to solve the issue. My Kaggle package dependency manager was not worked somehow. I have just changed importing from notebooks.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 3255410,
      "author_name": "mdferozahmedafm",
      "author_url": "",
      "post_date": "07/28/2025 15:54:09",
      "content": "<p>I faced a similar issue before. In many cases, the problem is that while the local run (run_local_gateway) works fine, the serve() function fails silently during submission.</p>\n<p>A few things to check:</p>\n<p>Make sure your notebook is committed, not just debug-run.</p>\n<p>Load the model inside the predict function, or at least lazy-load it to avoid long startup delays.</p>\n<p>Check that all required files (like model weights) are added to the input section of the notebook.</p>\n<p>Add print() statements to trace what’s happening during serve() — these show up in the logs.</p>\n<p>You can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.</p>\n<p>Also, check the logs after submission — they often reveal silent errors or timeouts during server startup.</p>\n<p>Let me know if you want help reviewing the code or setup.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3265116,
          "author_name": "gnanasenthilpro",
          "author_url": "",
          "post_date": "08/07/2025 03:43:00",
          "content": "<blockquote>\n  <p>You can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.</p>\n</blockquote>\n<p>After a while I understood, I should have done this at first..</p>\n<p>Thanks for the tip.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3272449,
      "author_name": "ikarus99",
      "author_url": "",
      "post_date": "08/21/2025 01:25:52",
      "content": "<p>Notebook Inference Server Error<br>\nYour submission notebook did not register the expected endpoint to your inference server.</p>\n<p>How to solve Gateway Runtime Error?</p>\n<pre><code>\nGatewayRuntimeError                       Traceback (most recent call )\n/tmp/ipykernel_36/py  &lt;cell : &gt;()\n           inference_server.serve()\n       :\n\n               data_paths=(\n                   ,\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3255159": "I ran my inference notebook. The last cell is below.\n\n```\ninference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)\n\nif os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    inference_server.serve()\nelse:\n    inference_server.run_local_gateway(\n        data_paths=(\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/train.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/train_demographics.csv',\n        )\n    )\n```\n\nThe running was successful within 1 hour, but when submitting, \"Notebook Inference Server Never Started\" error occured in a few minutes.\nWhat is the reason of this? Has anyone faced this issue?",
    "3255200": "if the notebook  took more than 15 mins before the  predict function start it will raise this error, so make a new notebook for direct inference",
    "3255207": "Thanks for answering, but the error occured about 2 min. after submitting. So it was weird...",
    "3255244": "I managed to solve the issue. My Kaggle package dependency manager was not worked somehow. I have just changed importing from notebooks.",
    "3255410": "I faced a similar issue before. In many cases, the problem is that while the local run (run_local_gateway) works fine, the serve() function fails silently during submission.\n\nA few things to check:\n\nMake sure your notebook is committed, not just debug-run.\n\nLoad the model inside the predict function, or at least lazy-load it to avoid long startup delays.\n\nCheck that all required files (like model weights) are added to the input section of the notebook.\n\nAdd print() statements to trace what’s happening during serve() — these show up in the logs.\n\nYou can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.\n\nAlso, check the logs after submission — they often reveal silent errors or timeouts during server startup.\n\nLet me know if you want help reviewing the code or setup.",
    "3265116": ">You can test the setup by creating a simple dummy predict() first and confirming that the server starts properly.\n\nAfter a while I understood, I should have done this at first..\n\nThanks for the tip.",
    "3269132": "strangely I have also started getting this Notebook Inference Server Never Started",
    "3272449": "Notebook Inference Server Error\nYour submission notebook did not register the expected endpoint to your inference server.\n\nHow to solve Gateway Runtime Error?\n```\n---------------------------------------------------------------------------\nGatewayRuntimeError                       Traceback (most recent call last)\n/tmp/ipykernel_36/1232577806.py in <cell line: 0>()\n      5     inference_server.serve()\n      6 else:\n----> 7     inference_server.run_local_gateway(\n      8         data_paths=(\n      9             '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',\n```"
  },
  "source": "meta"
}