{
  "id": 201306,
  "title": "How to make a first successful submission when you know a little bit of Python",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/201306",
  "author_name": "Juan Smith Perera",
  "post_date": "2020-12-04T05:04:45.430000",
  "votes": 6,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I am new to Python so I wanted to share my two cents on how to make the first successful submission to this competition:</p>\n<p>1) I copied a wonderful notebook: <a href=\"https://www.kaggle.com/jessemostipak/getting-started-tpus-cassava-leaf-disease\" target=\"_blank\">https://www.kaggle.com/jessemostipak/getting-started-tpus-cassava-leaf-disease</a></p>\n<p>2) I  created two notebooks from 1). </p>\n<p>The first, to train the model, with the TPU and the Internet ON. TPUs are parallel procesors which allow neural networks to run faster. </p>\n<p>This notebook is simply 1) up to when the model is trained. See here: <a href=\"https://www.kaggle.com/jsmithperera/tpus-cassava-leaf-disease\" target=\"_blank\">https://www.kaggle.com/jsmithperera/tpus-cassava-leaf-disease</a></p>\n<p>The last line of this notebook saves the model: model.save('model.h5').</p>\n<p>3) The submission notebook is just the prediction and submission part of 1). See here: <a href=\"https://www.kaggle.com/jsmithperera/cassava-inference\" target=\"_blank\">https://www.kaggle.com/jsmithperera/cassava-inference</a></p>\n<p>There were two issues for me. The first was how to read the test data directly from '../input/cassava-leaf-disease-classification/test_tfrecords/ld_test*.tfrec', and not from a Kaggle Dataset, which apparently does not work when the Internet is off.</p>\n<p>The second issue was how to load the trained model. I did this following information I found elsewhere in Kaggle: </p>\n<p>a) First, you commit the trained notebook. This will create an output which includes the model. </p>\n<p>b) In the prediction notebook you press <strong>+Add Data</strong> in the upper right corner. It will show you a menú. Look for \"your work\" and, <em>voilà</em>, the trained model is there. Add it to the notebook.</p>\n<p>c)To read this model use the instruction: tf.keras.models.load_model('../input/tpus-cassava-leaf-disease/model.h5').</p>\n<p>These steps will give you your first successful submission for this competition. And then, the real game begins… </p>\n<p>Good luck. </p>",
  "messages": [
    {
      "id": 1101639,
      "postDate": "2020-12-04T05:04:45.430Z",
      "content": "<p>I am new to Python so I wanted to share my two cents on how to make the first successful submission to this competition:</p>\n<p>1) I copied a wonderful notebook: <a href=\"https://www.kaggle.com/jessemostipak/getting-started-tpus-cassava-leaf-disease\" target=\"_blank\">https://www.kaggle.com/jessemostipak/getting-started-tpus-cassava-leaf-disease</a></p>\n<p>2) I  created two notebooks from 1). </p>\n<p>The first, to train the model, with the TPU and the Internet ON. TPUs are parallel procesors which allow neural networks to run faster. </p>\n<p>This notebook is simply 1) up to when the model is trained. See here: <a href=\"https://www.kaggle.com/jsmithperera/tpus-cassava-leaf-disease\" target=\"_blank\">https://www.kaggle.com/jsmithperera/tpus-cassava-leaf-disease</a></p>\n<p>The last line of this notebook saves the model: model.save('model.h5').</p>\n<p>3) The submission notebook is just the prediction and submission part of 1). See here: <a href=\"https://www.kaggle.com/jsmithperera/cassava-inference\" target=\"_blank\">https://www.kaggle.com/jsmithperera/cassava-inference</a></p>\n<p>There were two issues for me. The first was how to read the test data directly from '../input/cassava-leaf-disease-classification/test_tfrecords/ld_test*.tfrec', and not from a Kaggle Dataset, which apparently does not work when the Internet is off.</p>\n<p>The second issue was how to load the trained model. I did this following information I found elsewhere in Kaggle: </p>\n<p>a) First, you commit the trained notebook. This will create an output which includes the model. </p>\n<p>b) In the prediction notebook you press <strong>+Add Data</strong> in the upper right corner. It will show you a menú. Look for \"your work\" and, <em>voilà</em>, the trained model is there. Add it to the notebook.</p>\n<p>c)To read this model use the instruction: tf.keras.models.load_model('../input/tpus-cassava-leaf-disease/model.h5').</p>\n<p>These steps will give you your first successful submission for this competition. And then, the real game begins… </p>\n<p>Good luck. </p>",
      "rawMarkdown": "I am new to Python so I wanted to share my two cents on how to make the first successful submission to this competition:\n\n1) I copied a wonderful notebook: https://www.kaggle.com/jessemostipak/getting-started-tpus-cassava-leaf-disease\n\n2) I  created two notebooks from 1). \n\nThe first, to train the model, with the TPU and the Internet ON. TPUs are parallel procesors which allow neural networks to run faster. \n\nThis notebook is simply 1) up to when the model is trained. See here: https://www.kaggle.com/jsmithperera/tpus-cassava-leaf-disease\n\nThe last line of this notebook saves the model: model.save('model.h5').\n\n3) The submission notebook is just the prediction and submission part of 1). See here: https://www.kaggle.com/jsmithperera/cassava-inference\n\nThere were two issues for me. The first was how to read the test data directly from '../input/cassava-leaf-disease-classification/test_tfrecords/ld_test*.tfrec', and not from a Kaggle Dataset, which apparently does not work when the Internet is off.\n\nThe second issue was how to load the trained model. I did this following information I found elsewhere in Kaggle: \n\na) First, you commit the trained notebook. This will create an output which includes the model. \n\nb) In the prediction notebook you press **+Add Data** in the upper right corner. It will show you a menú. Look for \"your work\" and, *voilà*, the trained model is there. Add it to the notebook.\n\nc)To read this model use the instruction: tf.keras.models.load_model('../input/tpus-cassava-leaf-disease/model.h5').\n\nThese steps will give you your first successful submission for this competition. And then, the real game begins... \n\nGood luck. \n\n\n\n\n",
      "votes": 6
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1101639": "I am new to Python so I wanted to share my two cents on how to make the first successful submission to this competition:\n\n1) I copied a wonderful notebook: https://www.kaggle.com/jessemostipak/getting-started-tpus-cassava-leaf-disease\n\n2) I  created two notebooks from 1). \n\nThe first, to train the model, with the TPU and the Internet ON. TPUs are parallel procesors which allow neural networks to run faster. \n\nThis notebook is simply 1) up to when the model is trained. See here: https://www.kaggle.com/jsmithperera/tpus-cassava-leaf-disease\n\nThe last line of this notebook saves the model: model.save('model.h5').\n\n3) The submission notebook is just the prediction and submission part of 1). See here: https://www.kaggle.com/jsmithperera/cassava-inference\n\nThere were two issues for me. The first was how to read the test data directly from '../input/cassava-leaf-disease-classification/test_tfrecords/ld_test*.tfrec', and not from a Kaggle Dataset, which apparently does not work when the Internet is off.\n\nThe second issue was how to load the trained model. I did this following information I found elsewhere in Kaggle: \n\na) First, you commit the trained notebook. This will create an output which includes the model. \n\nb) In the prediction notebook you press **+Add Data** in the upper right corner. It will show you a menú. Look for \"your work\" and, *voilà*, the trained model is there. Add it to the notebook.\n\nc)To read this model use the instruction: tf.keras.models.load_model('../input/tpus-cassava-leaf-disease/model.h5').\n\nThese steps will give you your first successful submission for this competition. And then, the real game begins... \n\nGood luck. \n\n\n\n\n"
  }
}