{
  "id": 234883,
  "title": "How downloading of pre-trained model will happen, when internet should be off",
  "url": "/competitions/plant-pathology-2021-fgvc8/discussion/234883",
  "author_name": "Debjyoti Banerjee",
  "post_date": "2021-04-26T17:40:26.071000",
  "votes": 0,
  "comment_count": 7,
  "views": 0,
  "content": "<p>I was trying to use pre-trained model while keeping the internet off, but it throws error like URL fetching didn't happen, which is obvious, so how can I use pre-trained model while keeping the internet off, as it is one of the rules?</p>",
  "messages": [
    {
      "id": 1285576,
      "postDate": "2021-04-27T05:22:50.533Z",
      "content": "<p>You can upload the pre-trained model using the Add or Upload Data functionality in the notebook. That way, you wouldn’t have to connect to the internet as the model will be locally available </p>",
      "rawMarkdown": "You can upload the pre-trained model using the Add or Upload Data functionality in the notebook. That way, you wouldn’t have to connect to the internet as the model will be locally available ",
      "votes": 1,
      "replies": [
        {
          "id": 1285659,
          "postDate": "2021-04-27T06:50:50.820Z",
          "content": "<p>weights_path = '../input/keras-pretrained-models/inception_resnet_v2_weights_tf_dim_ordering_tf_kernels_notop.h5'<br>\nThis is the path, right? when I am giving this path, it is throwing error<br>\nValueError: The <code>weights</code> argument should be either <code>None</code> (random initialization), <code>imagenet</code> (pre-training on ImageNet), or the path to the weights file to be loaded.</p>",
          "rawMarkdown": "weights_path = '../input/keras-pretrained-models/inception_resnet_v2_weights_tf_dim_ordering_tf_kernels_notop.h5'\nThis is the path, right? when I am giving this path, it is throwing error\nValueError: The `weights` argument should be either `None` (random initialization), `imagenet` (pre-training on ImageNet), or the path to the weights file to be loaded."
        },
        {
          "id": 1285721,
          "postDate": "2021-04-27T07:57:20.193Z",
          "content": "<p>Got it why the error was coming.</p>",
          "rawMarkdown": "Got it why the error was coming."
        },
        {
          "id": 1285910,
          "postDate": "2021-04-27T11:20:22.237Z",
          "content": "<p>You can't do it like that. You have to set <code>weights=None</code>, and then use <code>model.load_weights(...)</code>.</p>",
          "rawMarkdown": "You can't do it like that. You have to set `weights=None`, and then use `model.load_weights(...)`."
        },
        {
          "id": 1285921,
          "postDate": "2021-04-27T11:40:15.630Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1285924,
          "postDate": "2021-04-27T11:41:23.067Z",
          "content": "<p>ValueError: You are trying to load a weight file containing 448 layers into a model with 106 layers.<br>\nIt is throwing the above error. How can I resolve this?</p>",
          "rawMarkdown": "ValueError: You are trying to load a weight file containing 448 layers into a model with 106 layers.\nIt is throwing the above error. How can I resolve this?"
        },
        {
          "id": 1285951,
          "postDate": "2021-04-27T12:21:15.627Z",
          "content": "<p>Check if your model is the same as it was when you saved your weights.</p>",
          "rawMarkdown": "Check if your model is the same as it was when you saved your weights."
        }
      ]
    },
    {
      "id": 1285217,
      "postDate": "2021-04-26T17:40:26.070Z",
      "content": "<p>I was trying to use pre-trained model while keeping the internet off, but it throws error like URL fetching didn't happen, which is obvious, so how can I use pre-trained model while keeping the internet off, as it is one of the rules?</p>",
      "rawMarkdown": "I was trying to use pre-trained model while keeping the internet off, but it throws error like URL fetching didn't happen, which is obvious, so how can I use pre-trained model while keeping the internet off, as it is one of the rules?"
    }
  ],
  "comments": [
    {
      "id": 1285576,
      "author_name": "Mreenav S. Deka",
      "author_url": "",
      "post_date": "2021-04-27T05:22:50.533000",
      "content": "<p>You can upload the pre-trained model using the Add or Upload Data functionality in the notebook. That way, you wouldn’t have to connect to the internet as the model will be locally available </p>",
      "votes": 1,
      "replies": [
        {
          "id": 1285659,
          "author_name": "Debjyoti Banerjee",
          "author_url": "",
          "post_date": "2021-04-27T06:50:50.820000",
          "content": "<p>weights_path = '../input/keras-pretrained-models/inception_resnet_v2_weights_tf_dim_ordering_tf_kernels_notop.h5'<br>\nThis is the path, right? when I am giving this path, it is throwing error<br>\nValueError: The <code>weights</code> argument should be either <code>None</code> (random initialization), <code>imagenet</code> (pre-training on ImageNet), or the path to the weights file to be loaded.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1285721,
          "author_name": "Debjyoti Banerjee",
          "author_url": "",
          "post_date": "2021-04-27T07:57:20.193000",
          "content": "<p>Got it why the error was coming.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1285910,
          "author_name": "Araik Tamazian",
          "author_url": "",
          "post_date": "2021-04-27T11:20:22.237000",
          "content": "<p>You can't do it like that. You have to set <code>weights=None</code>, and then use <code>model.load_weights(...)</code>.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1285921,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-04-27T11:40:15.630000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1285924,
          "author_name": "Debjyoti Banerjee",
          "author_url": "",
          "post_date": "2021-04-27T11:41:23.067000",
          "content": "<p>ValueError: You are trying to load a weight file containing 448 layers into a model with 106 layers.<br>\nIt is throwing the above error. How can I resolve this?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1285951,
          "author_name": "Araik Tamazian",
          "author_url": "",
          "post_date": "2021-04-27T12:21:15.627000",
          "content": "<p>Check if your model is the same as it was when you saved your weights.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1285576": "You can upload the pre-trained model using the Add or Upload Data functionality in the notebook. That way, you wouldn’t have to connect to the internet as the model will be locally available ",
    "1285217": "I was trying to use pre-trained model while keeping the internet off, but it throws error like URL fetching didn't happen, which is obvious, so how can I use pre-trained model while keeping the internet off, as it is one of the rules?"
  }
}