{
  "id": 669732,
  "title": "Can I cancel a running notebook and still submit ?",
  "url": "/competitions/stanford-rna-3d-folding-2/discussion/669732",
  "author_name": "Tony Li",
  "post_date": "2026-01-24T03:24:59.947000",
  "votes": 5,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hi all — quick question about <strong>Stanford RNA 3D Folding Part 2</strong> notebook submissions.</p>\n<p>I’m running a notebook that takes ~1–2 hours. I’d like to <strong>stop/cancel the run</strong> to save GPU time and <strong>submit immediately</strong>.</p>\n<p>But Kaggle reports: <strong>“Submission file not found: <code>submission.csv</code>.”</strong></p>\n<p>I haven’t hit this in other competitions. Is there <strong>any way to submit without waiting for the notebook to finish and commit</strong>, or does Kaggle only allow submission from the final committed output in this comp? Thanks!</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22938014%2F46156076d48614578c8b3d9c7ca3b943%2F1.png?generation=1769225120216584&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": 3395969,
      "postDate": "2026-01-24T03:45:17.250Z",
      "content": "<p>Add this at the top. It creates a valid all-zeros <code>submission.csv</code> and exits when not running in Kaggle’s competition rerun; during the rerun it will continue normally.</p>\n<pre><code># --- Early-exit guard for local runs (put this as the very first cell) ---\nimport os\nimport sys\nimport pandas as pd\n\nflag = os.environ.get(\"KAGGLE_IS_COMPETITION_RERUN\")\n\n# Kaggle sets this to a truthy value during the submission rerun environment.\n# If not in that environment, write an all-zeros submission and stop.\nif not flag:\n    # Try to derive the correct row count / IDs from an available sequences file.\n    # (adjust paths if your competition uses different names)\n    candidate_seq_paths = [\n        \"/kaggle/input/stanford-rna-3d-folding-2/test_sequences.csv\",\n        \"/kaggle/input/stanford-rna-3d-folding-2/validation_sequences.csv\",\n        \"/kaggle/input/stanford-rna-3d-folding-2/train_sequences.csv\",\n    ]\n\n    seq_df = None\n    for p in candidate_seq_paths:\n        if os.path.exists(p):\n            seq_df = pd.read_csv(p)\n            break\n\n    if seq_df is None or \"target_id\" not in seq_df.columns or \"sequence\" not in seq_df.columns:\n        raise RuntimeError(\n            \"Not in competition rerun, and could not find a sequences file to build a valid zero submission.\\n\"\n            \"Make sure test_sequences.csv is available under /kaggle/input/... or adjust candidate_seq_paths.\"\n        )\n\n    rows = []\n    for row in seq_df.itertuples(index=False):\n        tid = row.target_id\n        seq = row.sequence\n        for i, base in enumerate(seq, start=1):\n            rec = {\n                \"ID\": f\"{tid}_{i}\",\n                \"resname\": base,\n                \"resid\": i,\n            }\n            for k in range(1, 6):\n                rec[f\"x_{k}\"] = 0.0\n                rec[f\"y_{k}\"] = 0.0\n                rec[f\"z_{k}\"] = 0.0\n            rows.append(rec)\n\n    out = pd.DataFrame(rows)\n\n    # Enforce official column order\n    cols = (\n        [\"ID\", \"resname\", \"resid\"] +\n        [f\"{ax}_{k}\" for k in range(1, 6) for ax in (\"x\", \"y\", \"z\")]\n    )\n    out = out[cols]\n    out.to_csv(\"submission.csv\", index=False)\n    print(\"Not in Kaggle competition rerun. Wrote zero submission.csv and exiting early.\")\n    raise SystemExit(0)\n\n# If flag is truthy: do nothing, notebook continues normally.\nprint(\"KAGGLE_IS_COMPETITION_RERUN detected -&gt; continuing normally.\")\n</code></pre>",
      "rawMarkdown": "Add this at the top. It creates a valid all-zeros `submission.csv` and exits when not running in Kaggle’s competition rerun; during the rerun it will continue normally.\n\n    # --- Early-exit guard for local runs (put this as the very first cell) ---\n    import os\n    import sys\n    import pandas as pd\n\n    flag = os.environ.get(\"KAGGLE_IS_COMPETITION_RERUN\")\n\n    # Kaggle sets this to a truthy value during the submission rerun environment.\n    # If not in that environment, write an all-zeros submission and stop.\n    if not flag:\n        # Try to derive the correct row count / IDs from an available sequences file.\n        # (adjust paths if your competition uses different names)\n        candidate_seq_paths = [\n            \"/kaggle/input/stanford-rna-3d-folding-2/test_sequences.csv\",\n            \"/kaggle/input/stanford-rna-3d-folding-2/validation_sequences.csv\",\n            \"/kaggle/input/stanford-rna-3d-folding-2/train_sequences.csv\",\n        ]\n\n        seq_df = None\n        for p in candidate_seq_paths:\n            if os.path.exists(p):\n                seq_df = pd.read_csv(p)\n                break\n\n        if seq_df is None or \"target_id\" not in seq_df.columns or \"sequence\" not in seq_df.columns:\n            raise RuntimeError(\n                \"Not in competition rerun, and could not find a sequences file to build a valid zero submission.\\n\"\n                \"Make sure test_sequences.csv is available under /kaggle/input/... or adjust candidate_seq_paths.\"\n            )\n\n        rows = []\n        for row in seq_df.itertuples(index=False):\n            tid = row.target_id\n            seq = row.sequence\n            for i, base in enumerate(seq, start=1):\n                rec = {\n                    \"ID\": f\"{tid}_{i}\",\n                    \"resname\": base,\n                    \"resid\": i,\n                }\n                for k in range(1, 6):\n                    rec[f\"x_{k}\"] = 0.0\n                    rec[f\"y_{k}\"] = 0.0\n                    rec[f\"z_{k}\"] = 0.0\n                rows.append(rec)\n\n        out = pd.DataFrame(rows)\n\n        # Enforce official column order\n        cols = (\n            [\"ID\", \"resname\", \"resid\"] +\n            [f\"{ax}_{k}\" for k in range(1, 6) for ax in (\"x\", \"y\", \"z\")]\n        )\n        out = out[cols]\n        out.to_csv(\"submission.csv\", index=False)\n        print(\"Not in Kaggle competition rerun. Wrote zero submission.csv and exiting early.\")\n        raise SystemExit(0)\n\n    # If flag is truthy: do nothing, notebook continues normally.\n    print(\"KAGGLE_IS_COMPETITION_RERUN detected -> continuing normally.\")\n",
      "votes": 6,
      "replies": [
        {
          "id": 3395972,
          "postDate": "2026-01-24T03:54:05.370Z",
          "content": "<p>Thanks very much — I really appreciate the help! This saved me a lot of time and GPU time 😄</p>",
          "rawMarkdown": "Thanks very much — I really appreciate the help! This saved me a lot of time and GPU time 😄",
          "votes": 3
        },
        {
          "id": 3396038,
          "postDate": "2026-01-24T06:41:34.190Z",
          "content": "<p>This is a great tip! Didn't know this was even possible.</p>",
          "rawMarkdown": "This is a great tip! Didn't know this was even possible."
        }
      ]
    },
    {
      "id": 3395966,
      "postDate": "2026-01-24T03:24:59.947Z",
      "content": "<p>Hi all — quick question about <strong>Stanford RNA 3D Folding Part 2</strong> notebook submissions.</p>\n<p>I’m running a notebook that takes ~1–2 hours. I’d like to <strong>stop/cancel the run</strong> to save GPU time and <strong>submit immediately</strong>.</p>\n<p>But Kaggle reports: <strong>“Submission file not found: <code>submission.csv</code>.”</strong></p>\n<p>I haven’t hit this in other competitions. Is there <strong>any way to submit without waiting for the notebook to finish and commit</strong>, or does Kaggle only allow submission from the final committed output in this comp? Thanks!</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22938014%2F46156076d48614578c8b3d9c7ca3b943%2F1.png?generation=1769225120216584&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Hi all — quick question about **Stanford RNA 3D Folding Part 2** notebook submissions.\n\nI’m running a notebook that takes ~1–2 hours. I’d like to **stop/cancel the run** to save GPU time and **submit immediately**.\n\nBut Kaggle reports: **“Submission file not found: `submission.csv`.”**\n\nI haven’t hit this in other competitions. Is there **any way to submit without waiting for the notebook to finish and commit**, or does Kaggle only allow submission from the final committed output in this comp? Thanks!\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22938014%2F46156076d48614578c8b3d9c7ca3b943%2F1.png?generation=1769225120216584&alt=media)",
      "votes": 5
    }
  ],
  "comments": [
    {
      "id": 3395969,
      "author_name": "Kaiser",
      "author_url": "",
      "post_date": "2026-01-24T03:45:17.250000",
      "content": "<p>Add this at the top. It creates a valid all-zeros <code>submission.csv</code> and exits when not running in Kaggle’s competition rerun; during the rerun it will continue normally.</p>\n<pre><code># --- Early-exit guard for local runs (put this as the very first cell) ---\nimport os\nimport sys\nimport pandas as pd\n\nflag = os.environ.get(\"KAGGLE_IS_COMPETITION_RERUN\")\n\n# Kaggle sets this to a truthy value during the submission rerun environment.\n# If not in that environment, write an all-zeros submission and stop.\nif not flag:\n    # Try to derive the correct row count / IDs from an available sequences file.\n    # (adjust paths if your competition uses different names)\n    candidate_seq_paths = [\n        \"/kaggle/input/stanford-rna-3d-folding-2/test_sequences.csv\",\n        \"/kaggle/input/stanford-rna-3d-folding-2/validation_sequences.csv\",\n        \"/kaggle/input/stanford-rna-3d-folding-2/train_sequences.csv\",\n    ]\n\n    seq_df = None\n    for p in candidate_seq_paths:\n        if os.path.exists(p):\n            seq_df = pd.read_csv(p)\n            break\n\n    if seq_df is None or \"target_id\" not in seq_df.columns or \"sequence\" not in seq_df.columns:\n        raise RuntimeError(\n            \"Not in competition rerun, and could not find a sequences file to build a valid zero submission.\\n\"\n            \"Make sure test_sequences.csv is available under /kaggle/input/... or adjust candidate_seq_paths.\"\n        )\n\n    rows = []\n    for row in seq_df.itertuples(index=False):\n        tid = row.target_id\n        seq = row.sequence\n        for i, base in enumerate(seq, start=1):\n            rec = {\n                \"ID\": f\"{tid}_{i}\",\n                \"resname\": base,\n                \"resid\": i,\n            }\n            for k in range(1, 6):\n                rec[f\"x_{k}\"] = 0.0\n                rec[f\"y_{k}\"] = 0.0\n                rec[f\"z_{k}\"] = 0.0\n            rows.append(rec)\n\n    out = pd.DataFrame(rows)\n\n    # Enforce official column order\n    cols = (\n        [\"ID\", \"resname\", \"resid\"] +\n        [f\"{ax}_{k}\" for k in range(1, 6) for ax in (\"x\", \"y\", \"z\")]\n    )\n    out = out[cols]\n    out.to_csv(\"submission.csv\", index=False)\n    print(\"Not in Kaggle competition rerun. Wrote zero submission.csv and exiting early.\")\n    raise SystemExit(0)\n\n# If flag is truthy: do nothing, notebook continues normally.\nprint(\"KAGGLE_IS_COMPETITION_RERUN detected -&gt; continuing normally.\")\n</code></pre>",
      "votes": 6,
      "replies": [
        {
          "id": 3395972,
          "author_name": "Tony Li",
          "author_url": "",
          "post_date": "2026-01-24T03:54:05.370000",
          "content": "<p>Thanks very much — I really appreciate the help! This saved me a lot of time and GPU time 😄</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 3396038,
          "author_name": "dataWr3cker",
          "author_url": "",
          "post_date": "2026-01-24T06:41:34.190000",
          "content": "<p>This is a great tip! Didn't know this was even possible.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3395969": "Add this at the top. It creates a valid all-zeros `submission.csv` and exits when not running in Kaggle’s competition rerun; during the rerun it will continue normally.\n\n    # --- Early-exit guard for local runs (put this as the very first cell) ---\n    import os\n    import sys\n    import pandas as pd\n\n    flag = os.environ.get(\"KAGGLE_IS_COMPETITION_RERUN\")\n\n    # Kaggle sets this to a truthy value during the submission rerun environment.\n    # If not in that environment, write an all-zeros submission and stop.\n    if not flag:\n        # Try to derive the correct row count / IDs from an available sequences file.\n        # (adjust paths if your competition uses different names)\n        candidate_seq_paths = [\n            \"/kaggle/input/stanford-rna-3d-folding-2/test_sequences.csv\",\n            \"/kaggle/input/stanford-rna-3d-folding-2/validation_sequences.csv\",\n            \"/kaggle/input/stanford-rna-3d-folding-2/train_sequences.csv\",\n        ]\n\n        seq_df = None\n        for p in candidate_seq_paths:\n            if os.path.exists(p):\n                seq_df = pd.read_csv(p)\n                break\n\n        if seq_df is None or \"target_id\" not in seq_df.columns or \"sequence\" not in seq_df.columns:\n            raise RuntimeError(\n                \"Not in competition rerun, and could not find a sequences file to build a valid zero submission.\\n\"\n                \"Make sure test_sequences.csv is available under /kaggle/input/... or adjust candidate_seq_paths.\"\n            )\n\n        rows = []\n        for row in seq_df.itertuples(index=False):\n            tid = row.target_id\n            seq = row.sequence\n            for i, base in enumerate(seq, start=1):\n                rec = {\n                    \"ID\": f\"{tid}_{i}\",\n                    \"resname\": base,\n                    \"resid\": i,\n                }\n                for k in range(1, 6):\n                    rec[f\"x_{k}\"] = 0.0\n                    rec[f\"y_{k}\"] = 0.0\n                    rec[f\"z_{k}\"] = 0.0\n                rows.append(rec)\n\n        out = pd.DataFrame(rows)\n\n        # Enforce official column order\n        cols = (\n            [\"ID\", \"resname\", \"resid\"] +\n            [f\"{ax}_{k}\" for k in range(1, 6) for ax in (\"x\", \"y\", \"z\")]\n        )\n        out = out[cols]\n        out.to_csv(\"submission.csv\", index=False)\n        print(\"Not in Kaggle competition rerun. Wrote zero submission.csv and exiting early.\")\n        raise SystemExit(0)\n\n    # If flag is truthy: do nothing, notebook continues normally.\n    print(\"KAGGLE_IS_COMPETITION_RERUN detected -> continuing normally.\")\n",
    "3395966": "Hi all — quick question about **Stanford RNA 3D Folding Part 2** notebook submissions.\n\nI’m running a notebook that takes ~1–2 hours. I’d like to **stop/cancel the run** to save GPU time and **submit immediately**.\n\nBut Kaggle reports: **“Submission file not found: `submission.csv`.”**\n\nI haven’t hit this in other competitions. Is there **any way to submit without waiting for the notebook to finish and commit**, or does Kaggle only allow submission from the final committed output in this comp? Thanks!\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22938014%2F46156076d48614578c8b3d9c7ca3b943%2F1.png?generation=1769225120216584&alt=media)"
  }
}