{
  "id": 582751,
  "title": "Facing difficulty in submission!",
  "url": "/competitions/cmi-detect-behavior-with-sensor-data/discussion/582751",
  "author_name": "",
  "post_date": "2025-06-02T14:18:14.609850800Z",
  "votes": 2,
  "comment_count": 5,
  "views": 0,
  "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5017969%2F1f879ff5dd7e14660180db9631a1f4af%2FCMI_kaggle.PNG?generation=1748873803303850&amp;alt=media\" alt=\"\"></p>\n<p>Why my submission is failed?<br>\nI have saved the file \"submission.parquet\" as well.</p>",
  "messages": [
    {
      "id": "3215660",
      "postDate": "06/02/2025 14:18:14",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5017969%2F1f879ff5dd7e14660180db9631a1f4af%2FCMI_kaggle.PNG?generation=1748873803303850&amp;alt=media\" alt=\"\"></p>\n<p>Why my submission is failed?<br>\nI have saved the file \"submission.parquet\" as well.</p>",
      "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5017969%2F1f879ff5dd7e14660180db9631a1f4af%2FCMI_kaggle.PNG?generation=1748873803303850&alt=media)\n\n\n\nWhy my submission is failed?\nI have saved the file \"submission.parquet\" as well.",
      "votes": null
    },
    {
      "id": "3215662",
      "postDate": "06/02/2025 14:23:48",
      "content": "<p>This is my code:</p>\n<h1>--- Prediction and Submission ---</h1>\n<h1>Load test data</h1>\n<p>test = pd.read_csv(test_path)<br>\ntest_demo = pd.read_csv(test_demo_path)</p>\n<h1>Merge demographic info</h1>\n<p>test = test.merge(test_demo, on=\"subject\", how=\"left\")</p>\n<h1>Ensure the same preprocessing as training data</h1>\n<p>X_test = test[features]</p>\n<h1>Predict</h1>\n<p>test['gesture_encoded'] = best_rf_model.predict(X_test)</p>\n<h1>Decode labels</h1>\n<p>test['gesture'] = le.inverse_transform(test['gesture_encoded'])</p>\n<h1>Prepare submission</h1>\n<p>submission = test[['sequence_id', 'gesture']].drop_duplicates()<br>\nsubmission.to_csv('submission.parquet', index=False)</p>\n<h1>Display head of submission</h1>\n<p>submission.head()</p>",
      "rawMarkdown": "This is my code:\n\n# --- Prediction and Submission ---\n# Load test data\ntest = pd.read_csv(test_path)\ntest_demo = pd.read_csv(test_demo_path)\n\n# Merge demographic info\ntest = test.merge(test_demo, on=\"subject\", how=\"left\")\n\n# Ensure the same preprocessing as training data\nX_test = test[features]\n\n# Predict\ntest['gesture_encoded'] = best_rf_model.predict(X_test)\n\n# Decode labels\ntest['gesture'] = le.inverse_transform(test['gesture_encoded'])\n\n# Prepare submission\nsubmission = test[['sequence_id', 'gesture']].drop_duplicates()\nsubmission.to_csv('submission.parquet', index=False)\n\n# Display head of submission\nsubmission.head()",
      "votes": null
    },
    {
      "id": "3215799",
      "postDate": "06/02/2025 16:52:43",
      "content": "<p><a href=\"https://www.kaggle.com/dplg007\" target=\"_blank\">@dplg007</a> you should check this official notebook. <a href=\"https://www.kaggle.com/code/sohier/cmi-2025-demo-submission\" target=\"_blank\">https://www.kaggle.com/code/sohier/cmi-2025-demo-submission</a></p>",
      "rawMarkdown": "dplg007 you should check this official notebook. https://www.kaggle.com/code/sohier/cmi-2025-demo-submission",
      "votes": null
    },
    {
      "id": "3215872",
      "postDate": "06/02/2025 18:38:23",
      "content": "<p>Thank you…</p>",
      "rawMarkdown": "Thank you...",
      "votes": null
    },
    {
      "id": "3216113",
      "postDate": "06/03/2025 06:10:04",
      "content": "<p>Nice Thank you mate</p>",
      "rawMarkdown": "Nice Thank you mate",
      "votes": null
    },
    {
      "id": "3222023",
      "postDate": "06/11/2025 18:06:06",
      "content": "<p>I confused.<br>\nI created model. Trained it.<br>\nI created predict function:<br>\ndef predict(sequence: pl.DataFrame, demographics: pl.DataFrame) -&gt; str:<br>\n    x = data_scalers_fillers.create_sensors_test_sample(sequence)<br>\n    meta = data_scalers_fillers.create_demographics_test_sample(demographics)<br>\n    x = torch.tensor(x, dtype=torch.float32).unsqueeze(0)     # shape: [1, T, D]<br>\n    meta = torch.tensor(meta, dtype=torch.float32)  # shape: [1, M]<br>\n    model.eval()<br>\n    with torch.no_grad():<br>\n        outputs = model(x, meta, None)<br>\n        pred = torch.argmax(outputs, dim=1).item()<br>\n    return gesture_mapping_back[pred]</p>\n<p>I ran this function on test.csv and it works.</p>\n<p>and I have this submission code:<br>\ninference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)</p>\n<p>if os.getenv('KAGGLE_IS_COMPETITION_RERUN'):<br>\n    inference_server.serve()<br>\nelse:<br>\n    inference_server.run_local_gateway(<br>\n        data_paths=(<br>\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',<br>\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv',<br>\n        )<br>\n    )</p>\n<p>so, how should I submit? just run this portion of code? Or still have to click submit button? I clicked and got:<br>\n'''<br>\nCannot submit<br>\nYour Notebook cannot use internet access in this competition. Please disable internet in the Notebook editor and save a new version.<br>\n'''<br>\nWhat does it mean?</p>",
      "rawMarkdown": "I confused.\nI created model. Trained it.\nI created predict function:\ndef predict(sequence: pl.DataFrame, demographics: pl.DataFrame) -> str:\n    x = data_scalers_fillers.create_sensors_test_sample(sequence)\n    meta = data_scalers_fillers.create_demographics_test_sample(demographics)\n    x = torch.tensor(x, dtype=torch.float32).unsqueeze(0)     # shape: [1, T, D]\n    meta = torch.tensor(meta, dtype=torch.float32)  # shape: [1, M]\n    model.eval()\n    with torch.no_grad():\n        outputs = model(x, meta, None)\n        pred = torch.argmax(outputs, dim=1).item()\n    return gesture_mapping_back[pred]\n\nI ran this function on test.csv and it works.\n\nand I have this submission code:\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/test.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv',\n        )\n    )\n\nso, how should I submit? just run this portion of code? Or still have to click submit button? I clicked and got:\n'''\nCannot submit\nYour Notebook cannot use internet access in this competition. Please disable internet in the Notebook editor and save a new version.\n'''\nWhat does it mean?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3215662,
      "author_name": "dplg007",
      "author_url": "",
      "post_date": "06/02/2025 14:23:48",
      "content": "<p>This is my code:</p>\n<h1>--- Prediction and Submission ---</h1>\n<h1>Load test data</h1>\n<p>test = pd.read_csv(test_path)<br>\ntest_demo = pd.read_csv(test_demo_path)</p>\n<h1>Merge demographic info</h1>\n<p>test = test.merge(test_demo, on=\"subject\", how=\"left\")</p>\n<h1>Ensure the same preprocessing as training data</h1>\n<p>X_test = test[features]</p>\n<h1>Predict</h1>\n<p>test['gesture_encoded'] = best_rf_model.predict(X_test)</p>\n<h1>Decode labels</h1>\n<p>test['gesture'] = le.inverse_transform(test['gesture_encoded'])</p>\n<h1>Prepare submission</h1>\n<p>submission = test[['sequence_id', 'gesture']].drop_duplicates()<br>\nsubmission.to_csv('submission.parquet', index=False)</p>\n<h1>Display head of submission</h1>\n<p>submission.head()</p>",
      "votes": null,
      "replies": [
        {
          "id": 3215799,
          "author_name": "chumajin",
          "author_url": "",
          "post_date": "06/02/2025 16:52:43",
          "content": "<p><a href=\"https://www.kaggle.com/dplg007\" target=\"_blank\">@dplg007</a> you should check this official notebook. <a href=\"https://www.kaggle.com/code/sohier/cmi-2025-demo-submission\" target=\"_blank\">https://www.kaggle.com/code/sohier/cmi-2025-demo-submission</a></p>",
          "votes": null,
          "replies": [
            {
              "id": 3215872,
              "author_name": "dplg007",
              "author_url": "",
              "post_date": "06/02/2025 18:38:23",
              "content": "<p>Thank you…</p>",
              "votes": null,
              "replies": []
            },
            {
              "id": 3216113,
              "author_name": "louisxvi07",
              "author_url": "",
              "post_date": "06/03/2025 06:10:04",
              "content": "<p>Nice Thank you mate</p>",
              "votes": null,
              "replies": []
            }
          ]
        },
        {
          "id": 3222023,
          "author_name": "dmitrikoltsov",
          "author_url": "",
          "post_date": "06/11/2025 18:06:06",
          "content": "<p>I confused.<br>\nI created model. Trained it.<br>\nI created predict function:<br>\ndef predict(sequence: pl.DataFrame, demographics: pl.DataFrame) -&gt; str:<br>\n    x = data_scalers_fillers.create_sensors_test_sample(sequence)<br>\n    meta = data_scalers_fillers.create_demographics_test_sample(demographics)<br>\n    x = torch.tensor(x, dtype=torch.float32).unsqueeze(0)     # shape: [1, T, D]<br>\n    meta = torch.tensor(meta, dtype=torch.float32)  # shape: [1, M]<br>\n    model.eval()<br>\n    with torch.no_grad():<br>\n        outputs = model(x, meta, None)<br>\n        pred = torch.argmax(outputs, dim=1).item()<br>\n    return gesture_mapping_back[pred]</p>\n<p>I ran this function on test.csv and it works.</p>\n<p>and I have this submission code:<br>\ninference_server = kaggle_evaluation.cmi_inference_server.CMIInferenceServer(predict)</p>\n<p>if os.getenv('KAGGLE_IS_COMPETITION_RERUN'):<br>\n    inference_server.serve()<br>\nelse:<br>\n    inference_server.run_local_gateway(<br>\n        data_paths=(<br>\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv',<br>\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv',<br>\n        )<br>\n    )</p>\n<p>so, how should I submit? just run this portion of code? Or still have to click submit button? I clicked and got:<br>\n'''<br>\nCannot submit<br>\nYour Notebook cannot use internet access in this competition. Please disable internet in the Notebook editor and save a new version.<br>\n'''<br>\nWhat does it mean?</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3215660": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5017969%2F1f879ff5dd7e14660180db9631a1f4af%2FCMI_kaggle.PNG?generation=1748873803303850&alt=media)\n\n\n\nWhy my submission is failed?\nI have saved the file \"submission.parquet\" as well.",
    "3215662": "This is my code:\n\n# --- Prediction and Submission ---\n# Load test data\ntest = pd.read_csv(test_path)\ntest_demo = pd.read_csv(test_demo_path)\n\n# Merge demographic info\ntest = test.merge(test_demo, on=\"subject\", how=\"left\")\n\n# Ensure the same preprocessing as training data\nX_test = test[features]\n\n# Predict\ntest['gesture_encoded'] = best_rf_model.predict(X_test)\n\n# Decode labels\ntest['gesture'] = le.inverse_transform(test['gesture_encoded'])\n\n# Prepare submission\nsubmission = test[['sequence_id', 'gesture']].drop_duplicates()\nsubmission.to_csv('submission.parquet', index=False)\n\n# Display head of submission\nsubmission.head()",
    "3215799": "dplg007 you should check this official notebook. https://www.kaggle.com/code/sohier/cmi-2025-demo-submission",
    "3215872": "Thank you...",
    "3216113": "Nice Thank you mate",
    "3222023": "I confused.\nI created model. Trained it.\nI created predict function:\ndef predict(sequence: pl.DataFrame, demographics: pl.DataFrame) -> str:\n    x = data_scalers_fillers.create_sensors_test_sample(sequence)\n    meta = data_scalers_fillers.create_demographics_test_sample(demographics)\n    x = torch.tensor(x, dtype=torch.float32).unsqueeze(0)     # shape: [1, T, D]\n    meta = torch.tensor(meta, dtype=torch.float32)  # shape: [1, M]\n    model.eval()\n    with torch.no_grad():\n        outputs = model(x, meta, None)\n        pred = torch.argmax(outputs, dim=1).item()\n    return gesture_mapping_back[pred]\n\nI ran this function on test.csv and it works.\n\nand I have this submission code:\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/test.csv',\n            '/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv',\n        )\n    )\n\nso, how should I submit? just run this portion of code? Or still have to click submit button? I clicked and got:\n'''\nCannot submit\nYour Notebook cannot use internet access in this competition. Please disable internet in the Notebook editor and save a new version.\n'''\nWhat does it mean?"
  },
  "source": "meta"
}