{
  "id": 210783,
  "title": "How to download weights if internet access is disabled ",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/210783",
  "author_name": "Fedorov Vladimir",
  "post_date": "2021-01-12T09:55:01.450000",
  "votes": 0,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Recently I faced with problem:<br>\nI couldnt download pretrained model with standard way: tf.keras.applications.EfficientNetB0(weights='imagenet') because Internet access disabled in this competition :</p>\n<p>check it <a href=\"url\" target=\"_blank\">https://www.youtube.com/watch?v=VaJEK6fycwM&amp;t=124s</a><br>\ninstead adding dataset find affordable to your model weights and then add them</p>\n<p>Examples:<br>\nmodel = tf.keras.applications.EfficientNetB0(<br>\n    include_top=True, weights='../input/tfkeras-efficientnet-weights/efficientnetb0.h5')</p>\n<p>or (if you dont want to include top)<br>\nmodel_2 = tf.keras.applications.EfficientNetB0(<br>\n    include_top=False, weights='../input/tfkeras-efficientnet-weights/efficientnetb0_notop.h5')<br>\n                                                                                                                                           <strong><em>_</em></strong></p>\n<p>For me the way to understanding it was quite difficult</p>",
  "messages": [
    {
      "id": 1150029,
      "postDate": "2021-01-12T10:05:17.207Z",
      "content": "<p>Firstly, you could add a Kaggle dataset to your notebook that contains the weights. I believe <a href=\"https://www.kaggle.com/search?q=tfkeras-efficientnet+in%3Adatasets\" target=\"_blank\">they already exist</a> (so you do not even need to create them).<br>\nSecondly, you could train a model in one notebook with internet enabled, and do the inference in another notebook that adds the training notebook's outputs as an input (to load the trained weights) and has internet disabled.<br>\nBoth approaches are commonly used.</p>",
      "rawMarkdown": "Firstly, you could add a Kaggle dataset to your notebook that contains the weights. I believe [they already exist](https://www.kaggle.com/search?q=tfkeras-efficientnet+in%3Adatasets) (so you do not even need to create them).\nSecondly, you could train a model in one notebook with internet enabled, and do the inference in another notebook that adds the training notebook's outputs as an input (to load the trained weights) and has internet disabled.\nBoth approaches are commonly used.",
      "votes": 2,
      "replies": [
        {
          "id": 1151264,
          "postDate": "2021-01-13T08:00:54.827Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1151263,
          "postDate": "2021-01-13T08:00:54.827Z",
          "content": "<p>Thanks!😷</p>",
          "rawMarkdown": "Thanks!😷\n"
        }
      ]
    },
    {
      "id": 1150020,
      "postDate": "2021-01-12T09:55:01.450Z",
      "content": "<p>Recently I faced with problem:<br>\nI couldnt download pretrained model with standard way: tf.keras.applications.EfficientNetB0(weights='imagenet') because Internet access disabled in this competition :</p>\n<p>check it <a href=\"url\" target=\"_blank\">https://www.youtube.com/watch?v=VaJEK6fycwM&amp;t=124s</a><br>\ninstead adding dataset find affordable to your model weights and then add them</p>\n<p>Examples:<br>\nmodel = tf.keras.applications.EfficientNetB0(<br>\n    include_top=True, weights='../input/tfkeras-efficientnet-weights/efficientnetb0.h5')</p>\n<p>or (if you dont want to include top)<br>\nmodel_2 = tf.keras.applications.EfficientNetB0(<br>\n    include_top=False, weights='../input/tfkeras-efficientnet-weights/efficientnetb0_notop.h5')<br>\n                                                                                                                                           <strong><em>_</em></strong></p>\n<p>For me the way to understanding it was quite difficult</p>",
      "rawMarkdown": "Recently I faced with problem:\nI couldnt download pretrained model with standard way: tf.keras.applications.EfficientNetB0(weights='imagenet') because Internet access disabled in this competition :\n\ncheck it [https://www.youtube.com/watch?v=VaJEK6fycwM&t=124s](url)\ninstead adding dataset find affordable to your model weights and then add them\n\nExamples:\nmodel = tf.keras.applications.EfficientNetB0(\n    include_top=True, weights='../input/tfkeras-efficientnet-weights/efficientnetb0.h5')\n\nor (if you dont want to include top)\nmodel_2 = tf.keras.applications.EfficientNetB0(\n    include_top=False, weights='../input/tfkeras-efficientnet-weights/efficientnetb0_notop.h5')\n                                                                                                                                           _______\n\n\nFor me the way to understanding it was quite difficult\n"
    }
  ],
  "comments": [
    {
      "id": 1150029,
      "author_name": "Björn",
      "author_url": "",
      "post_date": "2021-01-12T10:05:17.207000",
      "content": "<p>Firstly, you could add a Kaggle dataset to your notebook that contains the weights. I believe <a href=\"https://www.kaggle.com/search?q=tfkeras-efficientnet+in%3Adatasets\" target=\"_blank\">they already exist</a> (so you do not even need to create them).<br>\nSecondly, you could train a model in one notebook with internet enabled, and do the inference in another notebook that adds the training notebook's outputs as an input (to load the trained weights) and has internet disabled.<br>\nBoth approaches are commonly used.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1151264,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-01-13T08:00:54.827000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1151263,
          "author_name": "Fedorov Vladimir",
          "author_url": "",
          "post_date": "2021-01-13T08:00:54.827000",
          "content": "<p>Thanks!😷</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1150029": "Firstly, you could add a Kaggle dataset to your notebook that contains the weights. I believe [they already exist](https://www.kaggle.com/search?q=tfkeras-efficientnet+in%3Adatasets) (so you do not even need to create them).\nSecondly, you could train a model in one notebook with internet enabled, and do the inference in another notebook that adds the training notebook's outputs as an input (to load the trained weights) and has internet disabled.\nBoth approaches are commonly used.",
    "1150020": "Recently I faced with problem:\nI couldnt download pretrained model with standard way: tf.keras.applications.EfficientNetB0(weights='imagenet') because Internet access disabled in this competition :\n\ncheck it [https://www.youtube.com/watch?v=VaJEK6fycwM&t=124s](url)\ninstead adding dataset find affordable to your model weights and then add them\n\nExamples:\nmodel = tf.keras.applications.EfficientNetB0(\n    include_top=True, weights='../input/tfkeras-efficientnet-weights/efficientnetb0.h5')\n\nor (if you dont want to include top)\nmodel_2 = tf.keras.applications.EfficientNetB0(\n    include_top=False, weights='../input/tfkeras-efficientnet-weights/efficientnetb0_notop.h5')\n                                                                                                                                           _______\n\n\nFor me the way to understanding it was quite difficult\n"
  }
}