{
  "id": 201843,
  "title": "Notebook Timeout Error",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/201843",
  "author_name": "",
  "post_date": "2020-12-07T03:43:56.158995400Z",
  "votes": 2,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Hi all,</p>\n<p>I'm new to Kaggle and wondering if someone can help me out with this error I receive when I submit predictions.</p>\n<p>When I submit my csv file, the notebook runs for a very long time &gt; 9 hrs, and then I receive an error which says Notebook Timeout.</p>\n<p>By context, I am guessing it takes too long for inference? </p>\n<p>Is there any tips and tricks to help me debug this? </p>\n<ol>\n<li>I'm using the fastai library and transfer learning</li>\n<li>The architecture is resnet34. I copied resnet34 into the Add data section (my first few submissions had very low accuracy because it could not access the model)</li>\n<li>The model training happens just fine and the accuracy ended up around 0.86</li>\n</ol>\n<p>My notebook can be found here - <a href=\"https://www.kaggle.com/adityasswami/cassava-classifier\" target=\"_blank\">https://www.kaggle.com/adityasswami/cassava-classifier</a></p>\n<p>Any help from community will be much appreciated. :)</p>\n<p>Thanks!<br>\nAdi</p>",
  "messages": [
    {
      "id": "1104539",
      "postDate": "12/07/2020 03:43:56",
      "content": "<p>Hi all,</p>\n<p>I'm new to Kaggle and wondering if someone can help me out with this error I receive when I submit predictions.</p>\n<p>When I submit my csv file, the notebook runs for a very long time &gt; 9 hrs, and then I receive an error which says Notebook Timeout.</p>\n<p>By context, I am guessing it takes too long for inference? </p>\n<p>Is there any tips and tricks to help me debug this? </p>\n<ol>\n<li>I'm using the fastai library and transfer learning</li>\n<li>The architecture is resnet34. I copied resnet34 into the Add data section (my first few submissions had very low accuracy because it could not access the model)</li>\n<li>The model training happens just fine and the accuracy ended up around 0.86</li>\n</ol>\n<p>My notebook can be found here - <a href=\"https://www.kaggle.com/adityasswami/cassava-classifier\" target=\"_blank\">https://www.kaggle.com/adityasswami/cassava-classifier</a></p>\n<p>Any help from community will be much appreciated. :)</p>\n<p>Thanks!<br>\nAdi</p>",
      "rawMarkdown": "Hi all,\n\nI'm new to Kaggle and wondering if someone can help me out with this error I receive when I submit predictions.\n\nWhen I submit my csv file, the notebook runs for a very long time > 9 hrs, and then I receive an error which says Notebook Timeout.\n\nBy context, I am guessing it takes too long for inference? \n\nIs there any tips and tricks to help me debug this? \n\n1. I'm using the fastai library and transfer learning\n2. The architecture is resnet34. I copied resnet34 into the Add data section (my first few submissions had very low accuracy because it could not access the model)\n3. The model training happens just fine and the accuracy ended up around 0.86\n\nMy notebook can be found here - https://www.kaggle.com/adityasswami/cassava-classifier\n\nAny help from community will be much appreciated. :)\n\nThanks!\nAdi",
      "votes": null
    },
    {
      "id": "1104554",
      "postDate": "12/07/2020 04:11:49",
      "content": "<p>Most like it run out of memory.  You will need to re-design you submission to make prediction in batches, so that it does not run out of memory</p>",
      "rawMarkdown": "Most like it run out of memory.  You will need to re-design you submission to make prediction in batches, so that it does not run out of memory",
      "votes": null
    },
    {
      "id": "1104579",
      "postDate": "12/07/2020 04:42:03",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/luqing2\" target=\"_blank\">@luqing2</a>, </p>\n<p>Thank you for getting back! Do you have any suggestions on how I could make predictions in batches? </p>\n<p>Thanks!<br>\nAdi</p>",
      "rawMarkdown": "Hi @luqing2, \n\nThank you for getting back! Do you have any suggestions on how I could make predictions in batches? \n\nThanks!\nAdi",
      "votes": null
    },
    {
      "id": "1104666",
      "postDate": "12/07/2020 07:09:40",
      "content": "<p>Hi, please notice that your notebook includes training as well. Save the models and make another notebook just for inference. You can take a look at the published notebooks that may help you. Good Luck.</p>",
      "rawMarkdown": "Hi, please notice that your notebook includes training as well. Save the models and make another notebook just for inference. You can take a look at the published notebooks that may help you. Good Luck.",
      "votes": null
    },
    {
      "id": "1104854",
      "postDate": "12/07/2020 09:34:40",
      "content": "<p>Thanks a lot. I'll try that :)</p>",
      "rawMarkdown": "Thanks a lot. I'll try that :)",
      "votes": null
    },
    {
      "id": "1105058",
      "postDate": "12/07/2020 13:47:38",
      "content": "<p>I have created a notebook to train seperately. Inferencing in a seperate notebook works for me. Hope this helps. <a href=\"https://www.kaggle.com/epochs19/superbeginner-training-notebook\" target=\"_blank\">https://www.kaggle.com/epochs19/superbeginner-training-notebook</a></p>",
      "rawMarkdown": "I have created a notebook to train seperately. Inferencing in a seperate notebook works for me. Hope this helps. https://www.kaggle.com/epochs19/superbeginner-training-notebook",
      "votes": null
    },
    {
      "id": "1105120",
      "postDate": "12/07/2020 14:33:39",
      "content": "<p>What I did was to use a 'global variable' to hold the batch of images.  The global variable memory is re-used for every batch.   This way, the notebook does not need to re-allocate memory for every batch of the images.</p>\n<p>Python does gabbage collection,  but obviously it wasn't doing well.</p>",
      "rawMarkdown": "What I did was to use a 'global variable' to hold the batch of images.  The global variable memory is re-used for every batch.   This way, the notebook does not need to re-allocate memory for every batch of the images.\n\nPython does gabbage collection,  but obviously it wasn't doing well.",
      "votes": null
    },
    {
      "id": "1105443",
      "postDate": "12/07/2020 22:01:42",
      "content": "<p>Thanks Neha! I'll definitely try it. Thanks a lot for sharing your notebook. I did wonder… I hit the quick save button at the end of my notebook. Should I be saving it as a full version? :)</p>",
      "rawMarkdown": "Thanks Neha! I'll definitely try it. Thanks a lot for sharing your notebook. I did wonder... I hit the quick save button at the end of my notebook. Should I be saving it as a full version? :)",
      "votes": null
    },
    {
      "id": "1107957",
      "postDate": "12/10/2020 06:02:07",
      "content": "<p>Hi Aditya, am glad it helped. Yeah, you need to save the full version.</p>",
      "rawMarkdown": "Hi Aditya, am glad it helped. Yeah, you need to save the full version.",
      "votes": null
    },
    {
      "id": "1165069",
      "postDate": "01/22/2021 17:14:31",
      "content": "<p>Iam facing the same issue using R notebook. When I run the individual code chunks,it runs fine and created a submission.csv file.But to submit to competition I turn internet off and do a run and save all. This is always timing out. Does the execute and save run in background or do we need to keep the notebook page active ?</p>",
      "rawMarkdown": "Iam facing the same issue using R notebook. When I run the individual code chunks,it runs fine and created a submission.csv file.But to submit to competition I turn internet off and do a run and save all. This is always timing out. Does the execute and save run in background or do we need to keep the notebook page active ?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1104554,
      "author_name": "luqing2",
      "author_url": "",
      "post_date": "12/07/2020 04:11:49",
      "content": "<p>Most like it run out of memory.  You will need to re-design you submission to make prediction in batches, so that it does not run out of memory</p>",
      "votes": null,
      "replies": [
        {
          "id": 1104579,
          "author_name": "adityasswami",
          "author_url": "",
          "post_date": "12/07/2020 04:42:03",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/luqing2\" target=\"_blank\">@luqing2</a>, </p>\n<p>Thank you for getting back! Do you have any suggestions on how I could make predictions in batches? </p>\n<p>Thanks!<br>\nAdi</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1105120,
          "author_name": "luqing2",
          "author_url": "",
          "post_date": "12/07/2020 14:33:39",
          "content": "<p>What I did was to use a 'global variable' to hold the batch of images.  The global variable memory is re-used for every batch.   This way, the notebook does not need to re-allocate memory for every batch of the images.</p>\n<p>Python does gabbage collection,  but obviously it wasn't doing well.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1104666,
      "author_name": "ammarali32",
      "author_url": "",
      "post_date": "12/07/2020 07:09:40",
      "content": "<p>Hi, please notice that your notebook includes training as well. Save the models and make another notebook just for inference. You can take a look at the published notebooks that may help you. Good Luck.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1104854,
          "author_name": "adityasswami",
          "author_url": "",
          "post_date": "12/07/2020 09:34:40",
          "content": "<p>Thanks a lot. I'll try that :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1105058,
          "author_name": "epochs19",
          "author_url": "",
          "post_date": "12/07/2020 13:47:38",
          "content": "<p>I have created a notebook to train seperately. Inferencing in a seperate notebook works for me. Hope this helps. <a href=\"https://www.kaggle.com/epochs19/superbeginner-training-notebook\" target=\"_blank\">https://www.kaggle.com/epochs19/superbeginner-training-notebook</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1105443,
          "author_name": "adityasswami",
          "author_url": "",
          "post_date": "12/07/2020 22:01:42",
          "content": "<p>Thanks Neha! I'll definitely try it. Thanks a lot for sharing your notebook. I did wonder… I hit the quick save button at the end of my notebook. Should I be saving it as a full version? :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1107957,
          "author_name": "epochs19",
          "author_url": "",
          "post_date": "12/10/2020 06:02:07",
          "content": "<p>Hi Aditya, am glad it helped. Yeah, you need to save the full version.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1165069,
      "author_name": "gayathrirprog",
      "author_url": "",
      "post_date": "01/22/2021 17:14:31",
      "content": "<p>Iam facing the same issue using R notebook. When I run the individual code chunks,it runs fine and created a submission.csv file.But to submit to competition I turn internet off and do a run and save all. This is always timing out. Does the execute and save run in background or do we need to keep the notebook page active ?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1104539": "Hi all,\n\nI'm new to Kaggle and wondering if someone can help me out with this error I receive when I submit predictions.\n\nWhen I submit my csv file, the notebook runs for a very long time > 9 hrs, and then I receive an error which says Notebook Timeout.\n\nBy context, I am guessing it takes too long for inference? \n\nIs there any tips and tricks to help me debug this? \n\n1. I'm using the fastai library and transfer learning\n2. The architecture is resnet34. I copied resnet34 into the Add data section (my first few submissions had very low accuracy because it could not access the model)\n3. The model training happens just fine and the accuracy ended up around 0.86\n\nMy notebook can be found here - https://www.kaggle.com/adityasswami/cassava-classifier\n\nAny help from community will be much appreciated. :)\n\nThanks!\nAdi",
    "1104554": "Most like it run out of memory.  You will need to re-design you submission to make prediction in batches, so that it does not run out of memory",
    "1104579": "Hi @luqing2, \n\nThank you for getting back! Do you have any suggestions on how I could make predictions in batches? \n\nThanks!\nAdi",
    "1104666": "Hi, please notice that your notebook includes training as well. Save the models and make another notebook just for inference. You can take a look at the published notebooks that may help you. Good Luck.",
    "1104854": "Thanks a lot. I'll try that :)",
    "1105058": "I have created a notebook to train seperately. Inferencing in a seperate notebook works for me. Hope this helps. https://www.kaggle.com/epochs19/superbeginner-training-notebook",
    "1105120": "What I did was to use a 'global variable' to hold the batch of images.  The global variable memory is re-used for every batch.   This way, the notebook does not need to re-allocate memory for every batch of the images.\n\nPython does gabbage collection,  but obviously it wasn't doing well.",
    "1105443": "Thanks Neha! I'll definitely try it. Thanks a lot for sharing your notebook. I did wonder... I hit the quick save button at the end of my notebook. Should I be saving it as a full version? :)",
    "1107957": "Hi Aditya, am glad it helped. Yeah, you need to save the full version.",
    "1165069": "Iam facing the same issue using R notebook. When I run the individual code chunks,it runs fine and created a submission.csv file.But to submit to competition I turn internet off and do a run and save all. This is always timing out. Does the execute and save run in background or do we need to keep the notebook page active ?"
  },
  "source": "meta"
}