{
  "id": 446642,
  "title": "Notebook Threw Exception",
  "url": "/competitions/UBC-OCEAN/discussion/446642",
  "author_name": "jdonnelly0804",
  "post_date": "2023-10-12T13:26:32.606000",
  "votes": 6,
  "comment_count": 10,
  "views": 0,
  "content": "<p>Hi All,</p>\n<p>When running my notebook locally, I have no issues. I can restart the notebook, press run all, and have everything run fine. I have internet off when submitting, and every time I submit about 30 seconds in, the notebook gives me this error: \"Your notebook hit an unhandled error while rerunning your code. Note that the hidden dataset can be larger/smaller/different than the public dataset See more debugging tips\". </p>\n<p>The notebook itself however, successfully runs. Here are the logs:</p>\n<p>Successfully ran in 261.6s<br>\nAccelerator<br>\nGPU P100</p>\n<p>Environment<br>\nLatest Container Image</p>\n<p>Output<br>\n21 B</p>\n<p>Time<br>\n#<br>\nLog Message<br>\n12.0s    1   /opt/conda/lib/python3.10/site-packages/scipy/<strong>init</strong>.py:146: UserWarning: A NumPy version &gt;=1.16.5 and &lt;1.23.0 is required for this version of SciPy (detected version 1.23.5\n12.0s    2     warnings.warn(f\"A NumPy version &gt;={np_minversion} and &lt;{np_maxversion}\"<br>\n178.0s    3   538<br>\n178.0s    4   538<br>\n178.1s    5   (538, 224, 224, 3)<br>\n178.1s    6   (538,)<br>\n186.9s    7   /opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.<br>\n186.9s    8     warnings.warn(<br>\n186.9s    9   /opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or <code>None</code> for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing <code>weights=None</code>.<br>\n186.9s    10    warnings.warn(msg)<br>\n253.0s    11  Predicted class: 1<br>\n253.0s    12  Output probabilities: tensor([0.0073, 0.8386, 0.1164, 0.0114, 0.0263])<br>\n253.0s    13  Predicted class name: EC<br>\n258.5s    14  /opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"remove_papermill_header.RemovePapermillHeader\"] for containers is deprecated in traitlets 5.0. You can pass <code>--Exporter.preprocessors item</code> … multiple times to add items to a list.<br>\n258.5s    15    warn(<br>\n258.5s    16  [NbConvertApp] WARNING | Config option <code>kernel_spec_manager_class</code> not recognized by <code>NbConvertApp</code>.<br>\n258.5s    17  [NbConvertApp] Converting notebook <strong>notebook</strong>.ipynb to notebook<br>\n258.9s    18  [NbConvertApp] Writing 765566 bytes to <strong>notebook</strong>.ipynb<br>\n260.5s    19  /opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"nbconvert.preprocessors.ExtractOutputPreprocessor\"] for containers is deprecated in traitlets 5.0. You can pass <code>--Exporter.preprocessors item</code> … multiple times to add items to a list.<br>\n260.5s    20    warn(<br>\n260.5s    21  [NbConvertApp] WARNING | Config option <code>kernel_spec_manager_class</code> not recognized by <code>NbConvertApp</code>.<br>\n260.6s    22  [NbConvertApp] Converting notebook <strong>notebook</strong>.ipynb to html<br>\n261.5s    23  [NbConvertApp] Support files will be in <strong>results___files/\n261.5s    24  [NbConvertApp] Making directory __results___files\n261.5s    25  [NbConvertApp] Making directory __results___files\n261.5s    26  [NbConvertApp] Making directory __results___files\n261.5s    27  [NbConvertApp] Making directory __results___files\n261.5s    28  [NbConvertApp] Writing 317193 bytes to __results</strong>.html</p>\n<p>Any idea whats going on?</p>",
  "messages": [
    {
      "id": 2479170,
      "postDate": "2023-10-12T13:26:32.607Z",
      "content": "<p>Hi All,</p>\n<p>When running my notebook locally, I have no issues. I can restart the notebook, press run all, and have everything run fine. I have internet off when submitting, and every time I submit about 30 seconds in, the notebook gives me this error: \"Your notebook hit an unhandled error while rerunning your code. Note that the hidden dataset can be larger/smaller/different than the public dataset See more debugging tips\". </p>\n<p>The notebook itself however, successfully runs. Here are the logs:</p>\n<p>Successfully ran in 261.6s<br>\nAccelerator<br>\nGPU P100</p>\n<p>Environment<br>\nLatest Container Image</p>\n<p>Output<br>\n21 B</p>\n<p>Time<br>\n#<br>\nLog Message<br>\n12.0s    1   /opt/conda/lib/python3.10/site-packages/scipy/<strong>init</strong>.py:146: UserWarning: A NumPy version &gt;=1.16.5 and &lt;1.23.0 is required for this version of SciPy (detected version 1.23.5\n12.0s    2     warnings.warn(f\"A NumPy version &gt;={np_minversion} and &lt;{np_maxversion}\"<br>\n178.0s    3   538<br>\n178.0s    4   538<br>\n178.1s    5   (538, 224, 224, 3)<br>\n178.1s    6   (538,)<br>\n186.9s    7   /opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.<br>\n186.9s    8     warnings.warn(<br>\n186.9s    9   /opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or <code>None</code> for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing <code>weights=None</code>.<br>\n186.9s    10    warnings.warn(msg)<br>\n253.0s    11  Predicted class: 1<br>\n253.0s    12  Output probabilities: tensor([0.0073, 0.8386, 0.1164, 0.0114, 0.0263])<br>\n253.0s    13  Predicted class name: EC<br>\n258.5s    14  /opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"remove_papermill_header.RemovePapermillHeader\"] for containers is deprecated in traitlets 5.0. You can pass <code>--Exporter.preprocessors item</code> … multiple times to add items to a list.<br>\n258.5s    15    warn(<br>\n258.5s    16  [NbConvertApp] WARNING | Config option <code>kernel_spec_manager_class</code> not recognized by <code>NbConvertApp</code>.<br>\n258.5s    17  [NbConvertApp] Converting notebook <strong>notebook</strong>.ipynb to notebook<br>\n258.9s    18  [NbConvertApp] Writing 765566 bytes to <strong>notebook</strong>.ipynb<br>\n260.5s    19  /opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"nbconvert.preprocessors.ExtractOutputPreprocessor\"] for containers is deprecated in traitlets 5.0. You can pass <code>--Exporter.preprocessors item</code> … multiple times to add items to a list.<br>\n260.5s    20    warn(<br>\n260.5s    21  [NbConvertApp] WARNING | Config option <code>kernel_spec_manager_class</code> not recognized by <code>NbConvertApp</code>.<br>\n260.6s    22  [NbConvertApp] Converting notebook <strong>notebook</strong>.ipynb to html<br>\n261.5s    23  [NbConvertApp] Support files will be in <strong>results___files/\n261.5s    24  [NbConvertApp] Making directory __results___files\n261.5s    25  [NbConvertApp] Making directory __results___files\n261.5s    26  [NbConvertApp] Making directory __results___files\n261.5s    27  [NbConvertApp] Making directory __results___files\n261.5s    28  [NbConvertApp] Writing 317193 bytes to __results</strong>.html</p>\n<p>Any idea whats going on?</p>",
      "rawMarkdown": "Hi All,\n\nWhen running my notebook locally, I have no issues. I can restart the notebook, press run all, and have everything run fine. I have internet off when submitting, and every time I submit about 30 seconds in, the notebook gives me this error: \"Your notebook hit an unhandled error while rerunning your code. Note that the hidden dataset can be larger/smaller/different than the public dataset See more debugging tips\". \n\nThe notebook itself however, successfully runs. Here are the logs:\n\nSuccessfully ran in 261.6s\nAccelerator\nGPU P100\n\nEnvironment\nLatest Container Image\n\nOutput\n21 B\n\n\nTime\n#\nLog Message\n12.0s\t1\t/opt/conda/lib/python3.10/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.5\n12.0s\t2\t  warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion}\"\n178.0s\t3\t538\n178.0s\t4\t538\n178.1s\t5\t(538, 224, 224, 3)\n178.1s\t6\t(538,)\n186.9s\t7\t/opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.\n186.9s\t8\t  warnings.warn(\n186.9s\t9\t/opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=None`.\n186.9s\t10\t  warnings.warn(msg)\n253.0s\t11\tPredicted class: 1\n253.0s\t12\tOutput probabilities: tensor([0.0073, 0.8386, 0.1164, 0.0114, 0.0263])\n253.0s\t13\tPredicted class name: EC\n258.5s\t14\t/opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"remove_papermill_header.RemovePapermillHeader\"] for containers is deprecated in traitlets 5.0. You can pass `--Exporter.preprocessors item` ... multiple times to add items to a list.\n258.5s\t15\t  warn(\n258.5s\t16\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n258.5s\t17\t[NbConvertApp] Converting notebook __notebook__.ipynb to notebook\n258.9s\t18\t[NbConvertApp] Writing 765566 bytes to __notebook__.ipynb\n260.5s\t19\t/opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"nbconvert.preprocessors.ExtractOutputPreprocessor\"] for containers is deprecated in traitlets 5.0. You can pass `--Exporter.preprocessors item` ... multiple times to add items to a list.\n260.5s\t20\t  warn(\n260.5s\t21\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n260.6s\t22\t[NbConvertApp] Converting notebook __notebook__.ipynb to html\n261.5s\t23\t[NbConvertApp] Support files will be in __results___files/\n261.5s\t24\t[NbConvertApp] Making directory __results___files\n261.5s\t25\t[NbConvertApp] Making directory __results___files\n261.5s\t26\t[NbConvertApp] Making directory __results___files\n261.5s\t27\t[NbConvertApp] Making directory __results___files\n261.5s\t28\t[NbConvertApp] Writing 317193 bytes to __results__.html\n\nAny idea whats going on?",
      "votes": 5
    },
    {
      "id": 2482467,
      "postDate": "2023-10-15T04:26:39.687Z",
      "content": "<p>Were you able to get the cause. I am also facing the same.</p>",
      "rawMarkdown": "Were you able to get the cause. I am also facing the same.",
      "votes": 4,
      "replies": [
        {
          "id": 2490401,
          "postDate": "2023-10-20T16:33:31.577Z",
          "content": "<p>No :/ any update on your end?</p>",
          "rawMarkdown": "No :/ any update on your end?",
          "replies": [
            {
              "id": 2496496,
              "postDate": "2023-10-24T05:10:30.990Z",
              "content": "<p>I figured out that in my case the submission csv file was not getting created correctly. I hope you already know that during the notebook submission training data won't be available, so use 2 notebooks, one for training and another for inference. In inference notebook, check that the submission csv is generated correctly. One method i used to figure the issue out was by drawing inference on train data itself and checking that the submission csv is generated properly. Hope this helps you.</p>",
              "rawMarkdown": "I figured out that in my case the submission csv file was not getting created correctly. I hope you already know that during the notebook submission training data won't be available, so use 2 notebooks, one for training and another for inference. In inference notebook, check that the submission csv is generated correctly. One method i used to figure the issue out was by drawing inference on train data itself and checking that the submission csv is generated properly. Hope this helps you.",
              "votes": 5
            }
          ]
        }
      ]
    },
    {
      "id": 2490631,
      "postDate": "2023-10-20T21:22:09.400Z",
      "content": "<p>Hey. I had a similar issue and by trial and error (and approx. 20 wasted submissions) I figured out that the problem was the following:<br>\nI use OpenCV to load the PNGs. Since the images are so huge, I got an exception. It seems that the one provided test image was small enough. To fix this, you have to set the limit to a very high number:</p>\n<pre><code> the import!\nos = (,).()\nimport cv2\n</code></pre>\n<p>Hope this helps someone!</p>",
      "rawMarkdown": "Hey. I had a similar issue and by trial and error (and approx. 20 wasted submissions) I figured out that the problem was the following:\nI use OpenCV to load the PNGs. Since the images are so huge, I got an exception. It seems that the one provided test image was small enough. To fix this, you have to set the limit to a very high number:\n\n```\n#Before the import!\nos.environ[\"OPENCV_IO_MAX_IMAGE_PIXELS\"] = pow(2,40).__str__()\nimport cv2\n```\nHope this helps someone!",
      "votes": 1
    },
    {
      "id": 2957854,
      "postDate": "2024-08-13T13:31:28.333Z",
      "content": "<p>can you solve problem?</p>",
      "rawMarkdown": "can you solve problem?"
    },
    {
      "id": 2522416,
      "postDate": "2023-11-12T16:39:14.177Z",
      "content": "<p>same probleme  any help</p>",
      "rawMarkdown": "same probleme  any help",
      "replies": [
        {
          "id": 2522607,
          "postDate": "2023-11-12T21:13:38.790Z",
          "content": "<p>Have you tried splitting your notebook into training and inference (submit this one)? See <a href=\"https://www.kaggle.com/competitions/UBC-OCEAN/discussion/446642#2496496\" target=\"_blank\">Balmukund's reply below</a>.</p>",
          "rawMarkdown": "Have you tried splitting your notebook into training and inference (submit this one)? See [Balmukund's reply below](https://www.kaggle.com/competitions/UBC-OCEAN/discussion/446642#2496496)."
        }
      ]
    },
    {
      "id": 2488062,
      "postDate": "2023-10-19T02:07:35.017Z",
      "content": "<p>I am also facing the same problem😭</p>",
      "rawMarkdown": "I am also facing the same problem😭",
      "replies": [
        {
          "id": 2505223,
          "postDate": "2023-10-30T13:17:33.963Z",
          "content": "<p>I have same problem.<br>\nif you solve it. can you let me know how to solve it?</p>",
          "rawMarkdown": "I have same problem.\nif you solve it. can you let me know how to solve it?"
        },
        {
          "id": 2534254,
          "postDate": "2023-11-22T14:04:04.167Z",
          "content": "<p>does annyone solve the problème  ?</p>",
          "rawMarkdown": "does annyone solve the problème  ?\n"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2482467,
      "author_name": "Balmukund",
      "author_url": "",
      "post_date": "2023-10-15T04:26:39.687000",
      "content": "<p>Were you able to get the cause. I am also facing the same.</p>",
      "votes": 4,
      "replies": [
        {
          "id": 2490401,
          "author_name": "jdonnelly0804",
          "author_url": "",
          "post_date": "2023-10-20T16:33:31.577000",
          "content": "<p>No :/ any update on your end?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2496496,
              "author_name": "Balmukund",
              "author_url": "",
              "post_date": "2023-10-24T05:10:30.990000",
              "content": "<p>I figured out that in my case the submission csv file was not getting created correctly. I hope you already know that during the notebook submission training data won't be available, so use 2 notebooks, one for training and another for inference. In inference notebook, check that the submission csv is generated correctly. One method i used to figure the issue out was by drawing inference on train data itself and checking that the submission csv is generated properly. Hope this helps you.</p>",
              "votes": 5,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2490631,
      "author_name": "Manuel K",
      "author_url": "",
      "post_date": "2023-10-20T21:22:09.400000",
      "content": "<p>Hey. I had a similar issue and by trial and error (and approx. 20 wasted submissions) I figured out that the problem was the following:<br>\nI use OpenCV to load the PNGs. Since the images are so huge, I got an exception. It seems that the one provided test image was small enough. To fix this, you have to set the limit to a very high number:</p>\n<pre><code> the import!\nos = (,).()\nimport cv2\n</code></pre>\n<p>Hope this helps someone!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2957854,
      "author_name": "Edna Mora",
      "author_url": "",
      "post_date": "2024-08-13T13:31:28.333000",
      "content": "<p>can you solve problem?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2522416,
      "author_name": "DIATTARA Amadou",
      "author_url": "",
      "post_date": "2023-11-12T16:39:14.177000",
      "content": "<p>same probleme  any help</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2522607,
          "author_name": "Russ Tokuyama",
          "author_url": "",
          "post_date": "2023-11-12T21:13:38.790000",
          "content": "<p>Have you tried splitting your notebook into training and inference (submit this one)? See <a href=\"https://www.kaggle.com/competitions/UBC-OCEAN/discussion/446642#2496496\" target=\"_blank\">Balmukund's reply below</a>.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2488062,
      "author_name": "Seeing Times",
      "author_url": "",
      "post_date": "2023-10-19T02:07:35.017000",
      "content": "<p>I am also facing the same problem😭</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2505223,
          "author_name": "JoongSub Lim",
          "author_url": "",
          "post_date": "2023-10-30T13:17:33.963000",
          "content": "<p>I have same problem.<br>\nif you solve it. can you let me know how to solve it?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2534254,
          "author_name": "DIATTARA Amadou",
          "author_url": "",
          "post_date": "2023-11-22T14:04:04.167000",
          "content": "<p>does annyone solve the problème  ?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2479170": "Hi All,\n\nWhen running my notebook locally, I have no issues. I can restart the notebook, press run all, and have everything run fine. I have internet off when submitting, and every time I submit about 30 seconds in, the notebook gives me this error: \"Your notebook hit an unhandled error while rerunning your code. Note that the hidden dataset can be larger/smaller/different than the public dataset See more debugging tips\". \n\nThe notebook itself however, successfully runs. Here are the logs:\n\nSuccessfully ran in 261.6s\nAccelerator\nGPU P100\n\nEnvironment\nLatest Container Image\n\nOutput\n21 B\n\n\nTime\n#\nLog Message\n12.0s\t1\t/opt/conda/lib/python3.10/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.5\n12.0s\t2\t  warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion}\"\n178.0s\t3\t538\n178.0s\t4\t538\n178.1s\t5\t(538, 224, 224, 3)\n178.1s\t6\t(538,)\n186.9s\t7\t/opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.\n186.9s\t8\t  warnings.warn(\n186.9s\t9\t/opt/conda/lib/python3.10/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=None`.\n186.9s\t10\t  warnings.warn(msg)\n253.0s\t11\tPredicted class: 1\n253.0s\t12\tOutput probabilities: tensor([0.0073, 0.8386, 0.1164, 0.0114, 0.0263])\n253.0s\t13\tPredicted class name: EC\n258.5s\t14\t/opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"remove_papermill_header.RemovePapermillHeader\"] for containers is deprecated in traitlets 5.0. You can pass `--Exporter.preprocessors item` ... multiple times to add items to a list.\n258.5s\t15\t  warn(\n258.5s\t16\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n258.5s\t17\t[NbConvertApp] Converting notebook __notebook__.ipynb to notebook\n258.9s\t18\t[NbConvertApp] Writing 765566 bytes to __notebook__.ipynb\n260.5s\t19\t/opt/conda/lib/python3.10/site-packages/traitlets/traitlets.py:2930: FutureWarning: --Exporter.preprocessors=[\"nbconvert.preprocessors.ExtractOutputPreprocessor\"] for containers is deprecated in traitlets 5.0. You can pass `--Exporter.preprocessors item` ... multiple times to add items to a list.\n260.5s\t20\t  warn(\n260.5s\t21\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n260.6s\t22\t[NbConvertApp] Converting notebook __notebook__.ipynb to html\n261.5s\t23\t[NbConvertApp] Support files will be in __results___files/\n261.5s\t24\t[NbConvertApp] Making directory __results___files\n261.5s\t25\t[NbConvertApp] Making directory __results___files\n261.5s\t26\t[NbConvertApp] Making directory __results___files\n261.5s\t27\t[NbConvertApp] Making directory __results___files\n261.5s\t28\t[NbConvertApp] Writing 317193 bytes to __results__.html\n\nAny idea whats going on?",
    "2482467": "Were you able to get the cause. I am also facing the same.",
    "2490631": "Hey. I had a similar issue and by trial and error (and approx. 20 wasted submissions) I figured out that the problem was the following:\nI use OpenCV to load the PNGs. Since the images are so huge, I got an exception. It seems that the one provided test image was small enough. To fix this, you have to set the limit to a very high number:\n\n```\n#Before the import!\nos.environ[\"OPENCV_IO_MAX_IMAGE_PIXELS\"] = pow(2,40).__str__()\nimport cv2\n```\nHope this helps someone!",
    "2957854": "can you solve problem?",
    "2522416": "same probleme  any help",
    "2488062": "I am also facing the same problem😭"
  }
}