{
  "id": 199372,
  "title": "Small (but crucial) tip for beginners regarding using separate notebooks for training and inference",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/199372",
  "author_name": "",
  "post_date": "2020-11-25T13:44:53.596557500Z",
  "votes": 2,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Since we can't use TPUs in the notebooks used for submission in this competition, a good strategy is to split off the model training part into a separate notebook, and conduct the training using TPUs there. The model weights from this notebook is then used as input for the inference notebook. We already have several great examples of this in the \"Notebooks\" section of the competition. </p>\n<p>An important thing to realize, however, if you use one of the notebook combos shared by other authors as basis for your own setup, is that you have to edit the \"Input\" section on the \"Data\" tab in the right hand side of the editor for the inference version of the notebook. If you already conducted training with your own (modified) version of the training notebook, your weights from that run will be saved. But if you then go ahead and run the original author's inference notebook without modification, it will actually still use the weights from the author's original version of the training notebook. To have your inference notebook load weights from YOUR version of the training notebook, you have to make sure to add it (the training notebook) as an input to the inference notebook (click \"Add data\" in the \"Data\" side panel), and update the file path accordingly in the code snippet that loads the weights (i.e., change it from the autor's training notebook to your own version).</p>\n<p>It's the first time I have worked with such a linked notebook setup myself, and hope others who also are  new to this will find this tip helpful! </p>",
  "messages": [
    {
      "id": "1090632",
      "postDate": "11/25/2020 13:44:53",
      "content": "<p>Since we can't use TPUs in the notebooks used for submission in this competition, a good strategy is to split off the model training part into a separate notebook, and conduct the training using TPUs there. The model weights from this notebook is then used as input for the inference notebook. We already have several great examples of this in the \"Notebooks\" section of the competition. </p>\n<p>An important thing to realize, however, if you use one of the notebook combos shared by other authors as basis for your own setup, is that you have to edit the \"Input\" section on the \"Data\" tab in the right hand side of the editor for the inference version of the notebook. If you already conducted training with your own (modified) version of the training notebook, your weights from that run will be saved. But if you then go ahead and run the original author's inference notebook without modification, it will actually still use the weights from the author's original version of the training notebook. To have your inference notebook load weights from YOUR version of the training notebook, you have to make sure to add it (the training notebook) as an input to the inference notebook (click \"Add data\" in the \"Data\" side panel), and update the file path accordingly in the code snippet that loads the weights (i.e., change it from the autor's training notebook to your own version).</p>\n<p>It's the first time I have worked with such a linked notebook setup myself, and hope others who also are  new to this will find this tip helpful! </p>",
      "rawMarkdown": "Since we can't use TPUs in the notebooks used for submission in this competition, a good strategy is to split off the model training part into a separate notebook, and conduct the training using TPUs there. The model weights from this notebook is then used as input for the inference notebook. We already have several great examples of this in the \"Notebooks\" section of the competition. \n\nAn important thing to realize, however, if you use one of the notebook combos shared by other authors as basis for your own setup, is that you have to edit the \"Input\" section on the \"Data\" tab in the right hand side of the editor for the inference version of the notebook. If you already conducted training with your own (modified) version of the training notebook, your weights from that run will be saved. But if you then go ahead and run the original author's inference notebook without modification, it will actually still use the weights from the author's original version of the training notebook. To have your inference notebook load weights from YOUR version of the training notebook, you have to make sure to add it (the training notebook) as an input to the inference notebook (click \"Add data\" in the \"Data\" side panel), and update the file path accordingly in the code snippet that loads the weights (i.e., change it from the autor's training notebook to your own version).\n\nIt's the first time I have worked with such a linked notebook setup myself, and hope others who also are  new to this will find this tip helpful!",
      "votes": null
    },
    {
      "id": "1188823",
      "postDate": "02/06/2021 14:38:18",
      "content": "<p>Hi  <a href=\"https://www.kaggle.com/thomasbrekkunnvik\" target=\"_blank\">@thomasbrekkunnvik</a> <br>\nFollowing your suggestion to split to two notebooks, any tips how to expedite the load of my model save .h5  (with add file)?<br>\nseems like take forever to load ~300M</p>\n<p>Thanks <br>\nYuval. </p>",
      "rawMarkdown": "Hi  @thomasbrekkunnvik \nFollowing your suggestion to split to two notebooks, any tips how to expedite the load of my model save <file>.h5  (with add file)?\nseems like take forever to load ~300M\n\nThanks \nYuval.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1188823,
      "author_name": "yuvalnavot",
      "author_url": "",
      "post_date": "02/06/2021 14:38:18",
      "content": "<p>Hi  <a href=\"https://www.kaggle.com/thomasbrekkunnvik\" target=\"_blank\">@thomasbrekkunnvik</a> <br>\nFollowing your suggestion to split to two notebooks, any tips how to expedite the load of my model save .h5  (with add file)?<br>\nseems like take forever to load ~300M</p>\n<p>Thanks <br>\nYuval. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1090632": "Since we can't use TPUs in the notebooks used for submission in this competition, a good strategy is to split off the model training part into a separate notebook, and conduct the training using TPUs there. The model weights from this notebook is then used as input for the inference notebook. We already have several great examples of this in the \"Notebooks\" section of the competition. \n\nAn important thing to realize, however, if you use one of the notebook combos shared by other authors as basis for your own setup, is that you have to edit the \"Input\" section on the \"Data\" tab in the right hand side of the editor for the inference version of the notebook. If you already conducted training with your own (modified) version of the training notebook, your weights from that run will be saved. But if you then go ahead and run the original author's inference notebook without modification, it will actually still use the weights from the author's original version of the training notebook. To have your inference notebook load weights from YOUR version of the training notebook, you have to make sure to add it (the training notebook) as an input to the inference notebook (click \"Add data\" in the \"Data\" side panel), and update the file path accordingly in the code snippet that loads the weights (i.e., change it from the autor's training notebook to your own version).\n\nIt's the first time I have worked with such a linked notebook setup myself, and hope others who also are  new to this will find this tip helpful!",
    "1188823": "Hi  @thomasbrekkunnvik \nFollowing your suggestion to split to two notebooks, any tips how to expedite the load of my model save <file>.h5  (with add file)?\nseems like take forever to load ~300M\n\nThanks \nYuval."
  },
  "source": "meta"
}