{
  "id": 478004,
  "title": "Submission successfully ran, but fails with 'Notebook out of Memory'",
  "url": "/competitions/home-credit-credit-risk-model-stability/discussion/478004",
  "author_name": "",
  "post_date": "2024-02-18T20:08:38.776058Z",
  "votes": 3,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I'm quite new to using notebooks and kaggle. So my assumption is that I'm doing something wrong. I just can't figure out what it is…</p>\n<p>I am trying to submit a notebook. When I run the notebook without submitting, everything works fine. </p>\n<p>When I click submit, the submission starts. While observing the log file I can clearly see that all the memory-intensive tasks get executed without a problem (data integration, training). Also I can see the lines being printed where the submission file is being prepared. </p>\n<p>However, there are some error messages at the end of the logfile:</p>\n<pre><code>`s     Check null:  \ns     /opt/conda/lib/python3/site-packages/traitlets/traitlets.py:: FutureWarning: --Exporter.preprocessors=[]  containers  deprecated  traitlets . You can  `--Exporter.preprocessors item` ... multiple times to add items to a .\n\ns       warn(\n\ns     [NbConvertApp] WARNING | Config option `kernel_spec_manager_class`  recognized by `NbConvertApp`.\n\ns     [NbConvertApp] Converting notebook __notebook__.ipynb to notebook\n\ns     [NbConvertApp] Writing   to __notebook__.ipynb\n\ns     /opt/conda/lib/python3/site-packages/traitlets/traitlets.py:: FutureWarning: --Exporter.preprocessors=[]  containers  deprecated  traitlets . You can  `--Exporter.preprocessors item` ... multiple times to add items to a .\n\ns       warn(\n\ns     [NbConvertApp] WARNING | Config option `kernel_spec_manager_class`  recognized by `NbConvertApp`.\n\ns     [NbConvertApp] Converting notebook __notebook__.ipynb to html\n\ns     [NbConvertApp] Writing   to __results__.html\n`\n</code></pre>\n<p>The message just above the log-file says: Successfully ran in 1424.25 sec.</p>\n<p>But in the overview of my submissions, this specific submission says: 'Notebook out of memory'…</p>\n<p>Summarized: The notebook seems to run fine while submitting, but in the end the submission fails due to memory issues.</p>\n<p>When I try a submission with greatly reduced training-sets everything works fine.</p>\n<p>Any clue what I might be doing wrong? </p>",
  "messages": [
    {
      "id": "2657884",
      "postDate": "02/18/2024 20:08:38",
      "content": "<p>I'm quite new to using notebooks and kaggle. So my assumption is that I'm doing something wrong. I just can't figure out what it is…</p>\n<p>I am trying to submit a notebook. When I run the notebook without submitting, everything works fine. </p>\n<p>When I click submit, the submission starts. While observing the log file I can clearly see that all the memory-intensive tasks get executed without a problem (data integration, training). Also I can see the lines being printed where the submission file is being prepared. </p>\n<p>However, there are some error messages at the end of the logfile:</p>\n<pre><code>`s     Check null:  \ns     /opt/conda/lib/python3/site-packages/traitlets/traitlets.py:: FutureWarning: --Exporter.preprocessors=[]  containers  deprecated  traitlets . You can  `--Exporter.preprocessors item` ... multiple times to add items to a .\n\ns       warn(\n\ns     [NbConvertApp] WARNING | Config option `kernel_spec_manager_class`  recognized by `NbConvertApp`.\n\ns     [NbConvertApp] Converting notebook __notebook__.ipynb to notebook\n\ns     [NbConvertApp] Writing   to __notebook__.ipynb\n\ns     /opt/conda/lib/python3/site-packages/traitlets/traitlets.py:: FutureWarning: --Exporter.preprocessors=[]  containers  deprecated  traitlets . You can  `--Exporter.preprocessors item` ... multiple times to add items to a .\n\ns       warn(\n\ns     [NbConvertApp] WARNING | Config option `kernel_spec_manager_class`  recognized by `NbConvertApp`.\n\ns     [NbConvertApp] Converting notebook __notebook__.ipynb to html\n\ns     [NbConvertApp] Writing   to __results__.html\n`\n</code></pre>\n<p>The message just above the log-file says: Successfully ran in 1424.25 sec.</p>\n<p>But in the overview of my submissions, this specific submission says: 'Notebook out of memory'…</p>\n<p>Summarized: The notebook seems to run fine while submitting, but in the end the submission fails due to memory issues.</p>\n<p>When I try a submission with greatly reduced training-sets everything works fine.</p>\n<p>Any clue what I might be doing wrong? </p>",
      "rawMarkdown": "I'm quite new to using notebooks and kaggle. So my assumption is that I'm doing something wrong. I just can't figure out what it is...\n\nI am trying to submit a notebook. When I run the notebook without submitting, everything works fine. \n\nWhen I click submit, the submission starts. While observing the log file I can clearly see that all the memory-intensive tasks get executed without a problem (data integration, training). Also I can see the lines being printed where the submission file is being prepared. \n\nHowever, there are some error messages at the end of the logfile:\n\n```python\n`1417.6s\t137\tCheck null:  False\n1421.2s\t138\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.\n\n1421.2s\t139\t  warn(\n\n1421.2s\t140\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n\n1421.2s\t141\t[NbConvertApp] Converting notebook __notebook__.ipynb to notebook\n\n1421.7s\t142\t[NbConvertApp] Writing 835706 bytes to __notebook__.ipynb\n\n1423.3s\t143\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.\n\n1423.3s\t144\t  warn(\n\n1423.3s\t145\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n\n1423.3s\t146\t[NbConvertApp] Converting notebook __notebook__.ipynb to html\n\n1424.4s\t147\t[NbConvertApp] Writing 632063 bytes to __results__.html\n`\n```\n\nThe message just above the log-file says: Successfully ran in 1424.25 sec.\n\nBut in the overview of my submissions, this specific submission says: 'Notebook out of memory'...\n\nSummarized: The notebook seems to run fine while submitting, but in the end the submission fails due to memory issues.\n\nWhen I try a submission with greatly reduced training-sets everything works fine.\n\nAny clue what I might be doing wrong?",
      "votes": null
    },
    {
      "id": "2658393",
      "postDate": "02/19/2024 06:49:59",
      "content": "<p><a href=\"https://www.kaggle.com/mathijsleenheer\" target=\"_blank\">@mathijsleenheer</a> it is likely that your notebook is consuming more memory than available causing this problem- you can create features and predict in batches to avoid/ prevent this error. As an example-</p>\n<ol>\n<li>Create features per week</li>\n<li>Predict with the model per week</li>\n<li>Store the predictions in the working directory</li>\n<li>Once all weeks are done, load all predictions (one-by-one) and concatenate to make 1 array</li>\n<li>Submit the array in [5] for leaderboard</li>\n</ol>",
      "rawMarkdown": "mathijsleenheer it is likely that your notebook is consuming more memory than available causing this problem- you can create features and predict in batches to avoid/ prevent this error. As an example-\n1. Create features per week\n2. Predict with the model per week\n3. Store the predictions in the working directory\n4. Once all weeks are done, load all predictions (one-by-one) and concatenate to make 1 array\n5. Submit the array in [5] for leaderboard",
      "votes": null
    },
    {
      "id": "2659368",
      "postDate": "02/19/2024 19:49:55",
      "content": "<p>Thank you so much for your clear explanation! <br>\nOne question to make sure I fully understand: does this imply that the predict uses way more memory during submission compared to running the notebook without submission?</p>",
      "rawMarkdown": "Thank you so much for your clear explanation! \nOne question to make sure I fully understand: does this imply that the predict uses way more memory during submission compared to running the notebook without submission?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2658393,
      "author_name": "ravi20076",
      "author_url": "",
      "post_date": "02/19/2024 06:49:59",
      "content": "<p><a href=\"https://www.kaggle.com/mathijsleenheer\" target=\"_blank\">@mathijsleenheer</a> it is likely that your notebook is consuming more memory than available causing this problem- you can create features and predict in batches to avoid/ prevent this error. As an example-</p>\n<ol>\n<li>Create features per week</li>\n<li>Predict with the model per week</li>\n<li>Store the predictions in the working directory</li>\n<li>Once all weeks are done, load all predictions (one-by-one) and concatenate to make 1 array</li>\n<li>Submit the array in [5] for leaderboard</li>\n</ol>",
      "votes": null,
      "replies": [
        {
          "id": 2659368,
          "author_name": "mathijsleenheer",
          "author_url": "",
          "post_date": "02/19/2024 19:49:55",
          "content": "<p>Thank you so much for your clear explanation! <br>\nOne question to make sure I fully understand: does this imply that the predict uses way more memory during submission compared to running the notebook without submission?</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2657884": "I'm quite new to using notebooks and kaggle. So my assumption is that I'm doing something wrong. I just can't figure out what it is...\n\nI am trying to submit a notebook. When I run the notebook without submitting, everything works fine. \n\nWhen I click submit, the submission starts. While observing the log file I can clearly see that all the memory-intensive tasks get executed without a problem (data integration, training). Also I can see the lines being printed where the submission file is being prepared. \n\nHowever, there are some error messages at the end of the logfile:\n\n```python\n`1417.6s\t137\tCheck null:  False\n1421.2s\t138\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.\n\n1421.2s\t139\t  warn(\n\n1421.2s\t140\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n\n1421.2s\t141\t[NbConvertApp] Converting notebook __notebook__.ipynb to notebook\n\n1421.7s\t142\t[NbConvertApp] Writing 835706 bytes to __notebook__.ipynb\n\n1423.3s\t143\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.\n\n1423.3s\t144\t  warn(\n\n1423.3s\t145\t[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.\n\n1423.3s\t146\t[NbConvertApp] Converting notebook __notebook__.ipynb to html\n\n1424.4s\t147\t[NbConvertApp] Writing 632063 bytes to __results__.html\n`\n```\n\nThe message just above the log-file says: Successfully ran in 1424.25 sec.\n\nBut in the overview of my submissions, this specific submission says: 'Notebook out of memory'...\n\nSummarized: The notebook seems to run fine while submitting, but in the end the submission fails due to memory issues.\n\nWhen I try a submission with greatly reduced training-sets everything works fine.\n\nAny clue what I might be doing wrong?",
    "2658393": "mathijsleenheer it is likely that your notebook is consuming more memory than available causing this problem- you can create features and predict in batches to avoid/ prevent this error. As an example-\n1. Create features per week\n2. Predict with the model per week\n3. Store the predictions in the working directory\n4. Once all weeks are done, load all predictions (one-by-one) and concatenate to make 1 array\n5. Submit the array in [5] for leaderboard",
    "2659368": "Thank you so much for your clear explanation! \nOne question to make sure I fully understand: does this imply that the predict uses way more memory during submission compared to running the notebook without submission?"
  },
  "source": "meta"
}