{
  "id": 205575,
  "title": "Can't access saved model from Output directory",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/205575",
  "author_name": "",
  "post_date": "2020-12-20T17:56:47.636207300Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Since you aren't allowed to use internet/tpu in your submission notebook I decided to use a separate training/prediction notebooks. In my training notebook I trained my model and saved it with <code>model.save(\"best_model.h5\")</code>. It shows up in the Output of the notebook. But when I want to load the model with <code>model = Keras.models.load_model(\"best_model.h5\")</code> it says that there is no such file. when I look if the output directory is there with <code>!cd .. ; ls</code> it just shows <code>input working lib</code> directories.</p>\n<p>How can I access my saved model?</p>",
  "messages": [
    {
      "id": "1120279",
      "postDate": "12/20/2020 17:56:47",
      "content": "<p>Since you aren't allowed to use internet/tpu in your submission notebook I decided to use a separate training/prediction notebooks. In my training notebook I trained my model and saved it with <code>model.save(\"best_model.h5\")</code>. It shows up in the Output of the notebook. But when I want to load the model with <code>model = Keras.models.load_model(\"best_model.h5\")</code> it says that there is no such file. when I look if the output directory is there with <code>!cd .. ; ls</code> it just shows <code>input working lib</code> directories.</p>\n<p>How can I access my saved model?</p>",
      "rawMarkdown": "Since you aren't allowed to use internet/tpu in your submission notebook I decided to use a separate training/prediction notebooks. In my training notebook I trained my model and saved it with `model.save(\"best_model.h5\")`. It shows up in the Output of the notebook. But when I want to load the model with `model = Keras.models.load_model(\"best_model.h5\")` it says that there is no such file. when I look if the output directory is there with `!cd .. ; ls` it just shows `input working lib` directories.\n\nHow can I access my saved model?",
      "votes": null
    },
    {
      "id": "1120529",
      "postDate": "12/20/2020 22:05:11",
      "content": "<p>I don't know if it will work but you can try this<br>\nClick on <strong>Add data</strong> in your inference notebook and select <strong>output files from notebook</strong><br>\nThen Choose your training notebook<br>\nHopefully you will be able to access your saved model</p>",
      "rawMarkdown": "I don't know if it will work but you can try this\nClick on **Add data** in your inference notebook and select **output files from notebook**\nThen Choose your training notebook\nHopefully you will be able to access your saved model",
      "votes": null
    },
    {
      "id": "1120651",
      "postDate": "12/21/2020 02:36:13",
      "content": "<p>Please check the right panel if the model was there, you can use the path like this \"/kaggle/working/best_model.h5\"<br>\nto save the model and use it for next time or inference notebook you can download it in the right panel then upload it again when you need it.</p>",
      "rawMarkdown": "Please check the right panel if the model was there, you can use the path like this \"/kaggle/working/best_model.h5\"\nto save the model and use it for next time or inference notebook you can download it in the right panel then upload it again when you need it.",
      "votes": null
    },
    {
      "id": "1121023",
      "postDate": "12/21/2020 09:42:00",
      "content": "<p>I think the agenda here is to use just notebook and public data to train complete model during private testing phase. If your code can generate your best model, it should regenerate during testing phase and then it should be used for testing data. <br>\nAlso please note that all of these should be done within 9 hours of time. you can not use TPU for this competition and only GPU is your best bet. </p>",
      "rawMarkdown": "I think the agenda here is to use just notebook and public data to train complete model during private testing phase. If your code can generate your best model, it should regenerate during testing phase and then it should be used for testing data. \nAlso please note that all of these should be done within 9 hours of time. you can not use TPU for this competition and only GPU is your best bet.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1120529,
      "author_name": "debarshichanda",
      "author_url": "",
      "post_date": "12/20/2020 22:05:11",
      "content": "<p>I don't know if it will work but you can try this<br>\nClick on <strong>Add data</strong> in your inference notebook and select <strong>output files from notebook</strong><br>\nThen Choose your training notebook<br>\nHopefully you will be able to access your saved model</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1120651,
      "author_name": "nguyenthanhnghi",
      "author_url": "",
      "post_date": "12/21/2020 02:36:13",
      "content": "<p>Please check the right panel if the model was there, you can use the path like this \"/kaggle/working/best_model.h5\"<br>\nto save the model and use it for next time or inference notebook you can download it in the right panel then upload it again when you need it.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1121023,
      "author_name": "digish",
      "author_url": "",
      "post_date": "12/21/2020 09:42:00",
      "content": "<p>I think the agenda here is to use just notebook and public data to train complete model during private testing phase. If your code can generate your best model, it should regenerate during testing phase and then it should be used for testing data. <br>\nAlso please note that all of these should be done within 9 hours of time. you can not use TPU for this competition and only GPU is your best bet. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1120279": "Since you aren't allowed to use internet/tpu in your submission notebook I decided to use a separate training/prediction notebooks. In my training notebook I trained my model and saved it with `model.save(\"best_model.h5\")`. It shows up in the Output of the notebook. But when I want to load the model with `model = Keras.models.load_model(\"best_model.h5\")` it says that there is no such file. when I look if the output directory is there with `!cd .. ; ls` it just shows `input working lib` directories.\n\nHow can I access my saved model?",
    "1120529": "I don't know if it will work but you can try this\nClick on **Add data** in your inference notebook and select **output files from notebook**\nThen Choose your training notebook\nHopefully you will be able to access your saved model",
    "1120651": "Please check the right panel if the model was there, you can use the path like this \"/kaggle/working/best_model.h5\"\nto save the model and use it for next time or inference notebook you can download it in the right panel then upload it again when you need it.",
    "1121023": "I think the agenda here is to use just notebook and public data to train complete model during private testing phase. If your code can generate your best model, it should regenerate during testing phase and then it should be used for testing data. \nAlso please note that all of these should be done within 9 hours of time. you can not use TPU for this competition and only GPU is your best bet."
  },
  "source": "meta"
}