{
  "id": 626004,
  "title": "Notebook Submission Issue",
  "url": "/competitions/csiro-biomass/discussion/626004",
  "author_name": "",
  "post_date": "2025-11-16T11:11:09.255876700Z",
  "votes": null,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Not able to submit the notebook to competition.\nlink of notebook: <a href=\"https://www.kaggle.com/code/vasant10/csiro-image2biomass-multi-output-regression\" target=\"_blank\">https://www.kaggle.com/code/vasant10/csiro-image2biomass-multi-output-regression</a></p>",
  "messages": [
    {
      "id": "3331036",
      "postDate": "11/16/2025 11:11:09",
      "content": "<p>Not able to submit the notebook to competition.\nlink of notebook: <a href=\"https://www.kaggle.com/code/vasant10/csiro-image2biomass-multi-output-regression\" target=\"_blank\">https://www.kaggle.com/code/vasant10/csiro-image2biomass-multi-output-regression</a></p>",
      "rawMarkdown": "Not able to submit the notebook to competition.\nlink of notebook: https://www.kaggle.com/code/vasant10/csiro-image2biomass-multi-output-regression",
      "votes": null
    },
    {
      "id": "3332443",
      "postDate": "11/16/2025 17:45:48",
      "content": "<p>Have you used the safe wrapper before with success?   </p>\n<p>What do you mean by \"Not able\".  Assuming your getting a notebook execution error ?</p>\n<p>At first glance I did not see any of the obvious errors that are common in this competition.  </p>",
      "rawMarkdown": "Have you used the safe wrapper before with success?   \n\nWhat do you mean by \"Not able\".  Assuming your getting a notebook execution error ?\n\nAt first glance I did not see any of the obvious errors that are common in this competition.",
      "votes": null
    },
    {
      "id": "3332732",
      "postDate": "11/16/2025 21:19:48",
      "content": "<p>I did the common thing of changing the code to predict against the train data rather than the test - this is the change</p>\n<p>`# Load test data</p>\n<p>test_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`</p>\n<p>Than I ran the notebook - it failed in this code section </p>\n<p>`model.eval()\nval_preds = []\nwith torch.no_grad():\n    for batch in test_loader:\n        imgs = batch[\"image\"].to(DEVICE)\n        with torch.amp.autocast('cuda', enabled=(DEVICE == \"cuda\")):\n            preds = model(imgs).cpu().numpy()\n        val_preds.append(preds)</p>\n<p>val_preds = np.hstack(val_preds)`</p>\n<p>With this error</p>\n<p>`---------------------------------------------------------------------------\nValueError                                Traceback (most recent call last)\n/tmp/ipykernel_19/2857409713.py in ()\n      8         val_preds.append(preds)\n      9 \n---&gt; 10 val_preds = np.hstack(val_preds)</p>\n<p>/usr/local/lib/python3.11/dist-packages/numpy/core/shape_base.py in hstack(tup, dtype, casting)\n    357         return _nx.concatenate(arrs, 0, dtype=dtype, casting=casting)\n    358     else:\n--&gt; 359         return _nx.concatenate(arrs, 1, dtype=dtype, casting=casting)\n    360 \n    361 </p>\n<p>ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 8 and the array at index 223 has size 1`</p>\n<p>Have not had time to look further - but might be the code works when you only have a single test image but fails with the real test folder is examined which has 800 images.</p>",
      "rawMarkdown": "I did the common thing of changing the code to predict against the train data rather than the test - this is the change\n\n`# Load test data\n\n\ntest_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`\n\nThan I ran the notebook - it failed in this code section \n\n`model.eval()\nval_preds = []\nwith torch.no_grad():\n    for batch in test_loader:\n        imgs = batch[\"image\"].to(DEVICE)\n        with torch.amp.autocast('cuda', enabled=(DEVICE == \"cuda\")):\n            preds = model(imgs).cpu().numpy()\n        val_preds.append(preds)\n\nval_preds = np.hstack(val_preds)`\n\nWith this error\n\n`---------------------------------------------------------------------------\nValueError                                Traceback (most recent call last)\n/tmp/ipykernel_19/2857409713.py in <cell line: 0>()\n      8         val_preds.append(preds)\n      9 \n---> 10 val_preds = np.hstack(val_preds)\n\n/usr/local/lib/python3.11/dist-packages/numpy/core/shape_base.py in hstack(tup, dtype, casting)\n    357         return _nx.concatenate(arrs, 0, dtype=dtype, casting=casting)\n    358     else:\n--> 359         return _nx.concatenate(arrs, 1, dtype=dtype, casting=casting)\n    360 \n    361 \n\nValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 8 and the array at index 223 has size 1`\n\n\nHave not had time to look further - but might be the code works when you only have a single test image but fails with the real test folder is examined which has 800 images.",
      "votes": null
    },
    {
      "id": "3332733",
      "postDate": "11/16/2025 21:21:01",
      "content": "<p>Ran it without the safe wrapper and it still failed.</p>",
      "rawMarkdown": "Ran it without the safe wrapper and it still failed.",
      "votes": null
    },
    {
      "id": "3333071",
      "postDate": "11/17/2025 04:36:05",
      "content": "<p>Looking some more - forked the notebook with a change suggested by the Gemini LLM after I pasted in the predict code and error.  Almost time for bed here - will report if that change worked tomorrow.   </p>\n<p>Changing batch size to 1 might also work, but a little loss in speed.</p>",
      "rawMarkdown": "Looking some more - forked the notebook with a change suggested by the Gemini LLM after I pasted in the predict code and error.  Almost time for bed here - will report if that change worked tomorrow.   \n\nChanging batch size to 1 might also work, but a little loss in speed.",
      "votes": null
    },
    {
      "id": "3334267",
      "postDate": "11/17/2025 13:29:18",
      "content": "<p>Batch size of 1 did not work - Gemini suggest code lead to errors in the next cell.  </p>\n<p>Suggest you do the predictions on the train data and work thru the issues that arise.\ntest_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`</p>",
      "rawMarkdown": "Batch size of 1 did not work - Gemini suggest code lead to errors in the next cell.  \n\nSuggest you do the predictions on the train data and work thru the issues that arise.\ntest_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3332443,
      "author_name": "pcjimmmy",
      "author_url": "",
      "post_date": "11/16/2025 17:45:48",
      "content": "<p>Have you used the safe wrapper before with success?   </p>\n<p>What do you mean by \"Not able\".  Assuming your getting a notebook execution error ?</p>\n<p>At first glance I did not see any of the obvious errors that are common in this competition.  </p>",
      "votes": null,
      "replies": [
        {
          "id": 3332733,
          "author_name": "pcjimmmy",
          "author_url": "",
          "post_date": "11/16/2025 21:21:01",
          "content": "<p>Ran it without the safe wrapper and it still failed.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3332732,
      "author_name": "pcjimmmy",
      "author_url": "",
      "post_date": "11/16/2025 21:19:48",
      "content": "<p>I did the common thing of changing the code to predict against the train data rather than the test - this is the change</p>\n<p>`# Load test data</p>\n<p>test_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`</p>\n<p>Than I ran the notebook - it failed in this code section </p>\n<p>`model.eval()\nval_preds = []\nwith torch.no_grad():\n    for batch in test_loader:\n        imgs = batch[\"image\"].to(DEVICE)\n        with torch.amp.autocast('cuda', enabled=(DEVICE == \"cuda\")):\n            preds = model(imgs).cpu().numpy()\n        val_preds.append(preds)</p>\n<p>val_preds = np.hstack(val_preds)`</p>\n<p>With this error</p>\n<p>`---------------------------------------------------------------------------\nValueError                                Traceback (most recent call last)\n/tmp/ipykernel_19/2857409713.py in ()\n      8         val_preds.append(preds)\n      9 \n---&gt; 10 val_preds = np.hstack(val_preds)</p>\n<p>/usr/local/lib/python3.11/dist-packages/numpy/core/shape_base.py in hstack(tup, dtype, casting)\n    357         return _nx.concatenate(arrs, 0, dtype=dtype, casting=casting)\n    358     else:\n--&gt; 359         return _nx.concatenate(arrs, 1, dtype=dtype, casting=casting)\n    360 \n    361 </p>\n<p>ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 8 and the array at index 223 has size 1`</p>\n<p>Have not had time to look further - but might be the code works when you only have a single test image but fails with the real test folder is examined which has 800 images.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3333071,
          "author_name": "pcjimmmy",
          "author_url": "",
          "post_date": "11/17/2025 04:36:05",
          "content": "<p>Looking some more - forked the notebook with a change suggested by the Gemini LLM after I pasted in the predict code and error.  Almost time for bed here - will report if that change worked tomorrow.   </p>\n<p>Changing batch size to 1 might also work, but a little loss in speed.</p>",
          "votes": null,
          "replies": [
            {
              "id": 3334267,
              "author_name": "pcjimmmy",
              "author_url": "",
              "post_date": "11/17/2025 13:29:18",
              "content": "<p>Batch size of 1 did not work - Gemini suggest code lead to errors in the next cell.  </p>\n<p>Suggest you do the predictions on the train data and work thru the issues that arise.\ntest_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3331036": "Not able to submit the notebook to competition.\nlink of notebook: https://www.kaggle.com/code/vasant10/csiro-image2biomass-multi-output-regression",
    "3332443": "Have you used the safe wrapper before with success?   \n\nWhat do you mean by \"Not able\".  Assuming your getting a notebook execution error ?\n\nAt first glance I did not see any of the obvious errors that are common in this competition.",
    "3332732": "I did the common thing of changing the code to predict against the train data rather than the test - this is the change\n\n`# Load test data\n\n\ntest_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`\n\nThan I ran the notebook - it failed in this code section \n\n`model.eval()\nval_preds = []\nwith torch.no_grad():\n    for batch in test_loader:\n        imgs = batch[\"image\"].to(DEVICE)\n        with torch.amp.autocast('cuda', enabled=(DEVICE == \"cuda\")):\n            preds = model(imgs).cpu().numpy()\n        val_preds.append(preds)\n\nval_preds = np.hstack(val_preds)`\n\nWith this error\n\n`---------------------------------------------------------------------------\nValueError                                Traceback (most recent call last)\n/tmp/ipykernel_19/2857409713.py in <cell line: 0>()\n      8         val_preds.append(preds)\n      9 \n---> 10 val_preds = np.hstack(val_preds)\n\n/usr/local/lib/python3.11/dist-packages/numpy/core/shape_base.py in hstack(tup, dtype, casting)\n    357         return _nx.concatenate(arrs, 0, dtype=dtype, casting=casting)\n    358     else:\n--> 359         return _nx.concatenate(arrs, 1, dtype=dtype, casting=casting)\n    360 \n    361 \n\nValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 8 and the array at index 223 has size 1`\n\n\nHave not had time to look further - but might be the code works when you only have a single test image but fails with the real test folder is examined which has 800 images.",
    "3332733": "Ran it without the safe wrapper and it still failed.",
    "3333071": "Looking some more - forked the notebook with a change suggested by the Gemini LLM after I pasted in the predict code and error.  Almost time for bed here - will report if that change worked tomorrow.   \n\nChanging batch size to 1 might also work, but a little loss in speed.",
    "3334267": "Batch size of 1 did not work - Gemini suggest code lead to errors in the next cell.  \n\nSuggest you do the predictions on the train data and work thru the issues that arise.\ntest_df = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")`"
  },
  "source": "meta"
}