{
  "id": 217024,
  "title": "Can someone please teach me how to submit notebook using TTA in Tensorflow?",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/217024",
  "author_name": "",
  "post_date": "2021-02-04T23:50:35.823645800Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I am a beginner here. Everytime I try to submit my notebook which is using 3- TTA , <br>\nmy notebook gets an error saying \"<strong>Notebook Exceeded Allowed Compute</strong>\" . <br>\nCan someone please help me solve this problem. </p>\n<p>An example notebook would be helpful.</p>\n<p>Thank you</p>",
  "messages": [
    {
      "id": "1186611",
      "postDate": "02/04/2021 23:50:35",
      "content": "<p>I am a beginner here. Everytime I try to submit my notebook which is using 3- TTA , <br>\nmy notebook gets an error saying \"<strong>Notebook Exceeded Allowed Compute</strong>\" . <br>\nCan someone please help me solve this problem. </p>\n<p>An example notebook would be helpful.</p>\n<p>Thank you</p>",
      "rawMarkdown": "I am a beginner here. Everytime I try to submit my notebook which is using 3- TTA , \nmy notebook gets an error saying \"**Notebook Exceeded Allowed Compute**\" . \nCan someone please help me solve this problem. \n\nAn example notebook would be helpful.\n\nThank you",
      "votes": null
    },
    {
      "id": "1186836",
      "postDate": "02/05/2021 04:37:29",
      "content": "<p>Hello! </p>\n<p>This could be because you are using a single notebook for both training and submission (which should not be done) or due to a mistake otherwise (e.g. pretrained 5 EfficientNetB4 ensemble should take about 1 hour to submit with 3 TTA if you use tfrecords and 2-3 hours if you use jpegs). I'd suggest using this <strong><a href=\"https://www.kaggle.com/dimitreoliveira/cassava-leaf-disease-tpu-v2-pods-inference\" target=\"_blank\">awesome inference notebook</a></strong> by <a href=\"https://www.kaggle.com/dimitreoliveira\" target=\"_blank\">@dimitreoliveira</a> for a quick start. </p>\n<p>Happy coding!</p>",
      "rawMarkdown": "Hello! \n\nThis could be because you are using a single notebook for both training and submission (which should not be done) or due to a mistake otherwise (e.g. pretrained 5 EfficientNetB4 ensemble should take about 1 hour to submit with 3 TTA if you use tfrecords and 2-3 hours if you use jpegs). I'd suggest using this **[awesome inference notebook](https://www.kaggle.com/dimitreoliveira/cassava-leaf-disease-tpu-v2-pods-inference)** by @dimitreoliveira for a quick start. \n\nHappy coding!",
      "votes": null
    },
    {
      "id": "1187182",
      "postDate": "02/05/2021 09:11:09",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/nihallimbu\" target=\"_blank\">@nihallimbu</a>  , The baisic idea is to train in a separate notebook , and perform prediction on a separate notebook .</p>\n<p>There is idea of callbacks in tensorflow  .<br>\n<a href=\"https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint\" target=\"_blank\">https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint</a></p>\n<p>Below is a sample which will help to save the final trained model , the invoke the saved model in another notebook and perform prediction </p>\n<p>model_checkpoint_callback = tf.keras.callbacks.ModelCheckpoint(<br>\n    filepath=checkpoint_filepath,<br>\n    save_weights_only=True,<br>\n    monitor='val_accuracy',<br>\n    mode='max',<br>\n    save_best_only=True)</p>",
      "rawMarkdown": "Hi @nihallimbu  , The baisic idea is to train in a separate notebook , and perform prediction on a separate notebook .\n\nThere is idea of callbacks in tensorflow  .\nhttps://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint\n\nBelow is a sample which will help to save the final trained model , the invoke the saved model in another notebook and perform prediction \n\nmodel_checkpoint_callback = tf.keras.callbacks.ModelCheckpoint(\n    filepath=checkpoint_filepath,\n    save_weights_only=True,\n    monitor='val_accuracy',\n    mode='max',\n    save_best_only=True)",
      "votes": null
    },
    {
      "id": "1187189",
      "postDate": "02/05/2021 09:21:12",
      "content": "<p>Thanks a lot. 👍</p>",
      "rawMarkdown": "Thanks a lot. 👍",
      "votes": null
    },
    {
      "id": "1187198",
      "postDate": "02/05/2021 09:28:10",
      "content": "<p>I submitted a seperate submission notebook and the result was that. I think it's because I used \"<strong>model.predict_generation()</strong>\" function.</p>\n<p>Thank a lot for giving your time to help out.</p>",
      "rawMarkdown": "I submitted a seperate submission notebook and the result was that. I think it's because I used \"**model.predict_generation()**\" function.\n\nThank a lot for giving your time to help out.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1186836,
      "author_name": "nickuzmenkov",
      "author_url": "",
      "post_date": "02/05/2021 04:37:29",
      "content": "<p>Hello! </p>\n<p>This could be because you are using a single notebook for both training and submission (which should not be done) or due to a mistake otherwise (e.g. pretrained 5 EfficientNetB4 ensemble should take about 1 hour to submit with 3 TTA if you use tfrecords and 2-3 hours if you use jpegs). I'd suggest using this <strong><a href=\"https://www.kaggle.com/dimitreoliveira/cassava-leaf-disease-tpu-v2-pods-inference\" target=\"_blank\">awesome inference notebook</a></strong> by <a href=\"https://www.kaggle.com/dimitreoliveira\" target=\"_blank\">@dimitreoliveira</a> for a quick start. </p>\n<p>Happy coding!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1187189,
          "author_name": "nihallimbu",
          "author_url": "",
          "post_date": "02/05/2021 09:21:12",
          "content": "<p>Thanks a lot. 👍</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1187182,
      "author_name": "ssarkar445",
      "author_url": "",
      "post_date": "02/05/2021 09:11:09",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/nihallimbu\" target=\"_blank\">@nihallimbu</a>  , The baisic idea is to train in a separate notebook , and perform prediction on a separate notebook .</p>\n<p>There is idea of callbacks in tensorflow  .<br>\n<a href=\"https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint\" target=\"_blank\">https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint</a></p>\n<p>Below is a sample which will help to save the final trained model , the invoke the saved model in another notebook and perform prediction </p>\n<p>model_checkpoint_callback = tf.keras.callbacks.ModelCheckpoint(<br>\n    filepath=checkpoint_filepath,<br>\n    save_weights_only=True,<br>\n    monitor='val_accuracy',<br>\n    mode='max',<br>\n    save_best_only=True)</p>",
      "votes": null,
      "replies": [
        {
          "id": 1187198,
          "author_name": "nihallimbu",
          "author_url": "",
          "post_date": "02/05/2021 09:28:10",
          "content": "<p>I submitted a seperate submission notebook and the result was that. I think it's because I used \"<strong>model.predict_generation()</strong>\" function.</p>\n<p>Thank a lot for giving your time to help out.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1186611": "I am a beginner here. Everytime I try to submit my notebook which is using 3- TTA , \nmy notebook gets an error saying \"**Notebook Exceeded Allowed Compute**\" . \nCan someone please help me solve this problem. \n\nAn example notebook would be helpful.\n\nThank you",
    "1186836": "Hello! \n\nThis could be because you are using a single notebook for both training and submission (which should not be done) or due to a mistake otherwise (e.g. pretrained 5 EfficientNetB4 ensemble should take about 1 hour to submit with 3 TTA if you use tfrecords and 2-3 hours if you use jpegs). I'd suggest using this **[awesome inference notebook](https://www.kaggle.com/dimitreoliveira/cassava-leaf-disease-tpu-v2-pods-inference)** by @dimitreoliveira for a quick start. \n\nHappy coding!",
    "1187182": "Hi @nihallimbu  , The baisic idea is to train in a separate notebook , and perform prediction on a separate notebook .\n\nThere is idea of callbacks in tensorflow  .\nhttps://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint\n\nBelow is a sample which will help to save the final trained model , the invoke the saved model in another notebook and perform prediction \n\nmodel_checkpoint_callback = tf.keras.callbacks.ModelCheckpoint(\n    filepath=checkpoint_filepath,\n    save_weights_only=True,\n    monitor='val_accuracy',\n    mode='max',\n    save_best_only=True)",
    "1187189": "Thanks a lot. 👍",
    "1187198": "I submitted a seperate submission notebook and the result was that. I think it's because I used \"**model.predict_generation()**\" function.\n\nThank a lot for giving your time to help out."
  },
  "source": "meta"
}