{
  "id": 129133,
  "title": "kernel keeps searching online for pretrained model",
  "url": "/competitions/bengaliai-cv19/discussion/129133",
  "author_name": "",
  "post_date": "2020-02-05T17:42:25.574577Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi guys,</p>\n\n<p>Being not allowed to use the internet on the submision kernel, I used pretrainedmodels as dataset and pip install it. So far, so good.\nThe bad part apears when I try to use a specific pretrained model with this sintax\n<code>model=pretrainedmodels.__dict__[pretrainedModelArhitecture](pretrained=pretrainedModelWeights).to(device)</code>\nThe kernels tries to connect to data.lip6.fr/cadene/pretrainedmodels/se_resnext101_32x4d-3b2fe3d8.pth to download the model and of course it cannot downloaded becose the internet is off.\nHow did you tackle this issue? you make a class where you define the whole resnext or whatever arhitecture do you want to use or you upload also this .pth file as dataset and if so how do you make it so it will search locally for it and not go online?</p>\n\n<p>Thank you !</p>",
  "messages": [
    {
      "id": "737732",
      "postDate": "02/05/2020 17:42:25",
      "content": "<p>Hi guys,</p>\n\n<p>Being not allowed to use the internet on the submision kernel, I used pretrainedmodels as dataset and pip install it. So far, so good.\nThe bad part apears when I try to use a specific pretrained model with this sintax\n<code>model=pretrainedmodels.__dict__[pretrainedModelArhitecture](pretrained=pretrainedModelWeights).to(device)</code>\nThe kernels tries to connect to data.lip6.fr/cadene/pretrainedmodels/se_resnext101_32x4d-3b2fe3d8.pth to download the model and of course it cannot downloaded becose the internet is off.\nHow did you tackle this issue? you make a class where you define the whole resnext or whatever arhitecture do you want to use or you upload also this .pth file as dataset and if so how do you make it so it will search locally for it and not go online?</p>\n\n<p>Thank you !</p>",
      "rawMarkdown": "Hi guys,\n\nBeing not allowed to use the internet on the submision kernel, I used pretrainedmodels as dataset and pip install it. So far, so good.\nThe bad part apears when I try to use a specific pretrained model with this sintax\n`model=pretrainedmodels.__dict__[pretrainedModelArhitecture](pretrained=pretrainedModelWeights).to(device)`\nThe kernels tries to connect to data.lip6.fr/cadene/pretrainedmodels/se_resnext101_32x4d-3b2fe3d8.pth to download the model and of course it cannot downloaded becose the internet is off.\nHow did you tackle this issue? you make a class where you define the whole resnext or whatever arhitecture do you want to use or you upload also this .pth file as dataset and if so how do you make it so it will search locally for it and not go online?\n\nThank you !",
      "votes": null
    },
    {
      "id": "737734",
      "postDate": "02/05/2020 17:45:26",
      "content": "<p>Upload the pretrained weights to the dataset as well. Create your model with <code>pretrained=False</code> and load the weights with <code>load_state_dict</code></p>",
      "rawMarkdown": "Upload the pretrained weights to the dataset as well. Create your model with `pretrained=False` and load the weights with `load_state_dict`",
      "votes": null
    },
    {
      "id": "737836",
      "postDate": "02/05/2020 20:40:58",
      "content": "<p>Worked like a charm, thanks <a href=\"/pestipeti\">@pestipeti</a> !</p>",
      "rawMarkdown": "Worked like a charm, thanks @pestipeti !",
      "votes": null
    },
    {
      "id": "737840",
      "postDate": "02/05/2020 20:42:53",
      "content": "<p>You're welcome.</p>",
      "rawMarkdown": "You're welcome.",
      "votes": null
    },
    {
      "id": "739851",
      "postDate": "02/08/2020 13:48:44",
      "content": "<p>And you can also upload the <code>pretrained</code> package as a dataset and pip install it.</p>",
      "rawMarkdown": "And you can also upload the `pretrained` package as a dataset and pip install it.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 737734,
      "author_name": "pestipeti",
      "author_url": "",
      "post_date": "02/05/2020 17:45:26",
      "content": "<p>Upload the pretrained weights to the dataset as well. Create your model with <code>pretrained=False</code> and load the weights with <code>load_state_dict</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 737836,
          "author_name": "vladvdv",
          "author_url": "",
          "post_date": "02/05/2020 20:40:58",
          "content": "<p>Worked like a charm, thanks <a href=\"/pestipeti\">@pestipeti</a> !</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 737840,
          "author_name": "pestipeti",
          "author_url": "",
          "post_date": "02/05/2020 20:42:53",
          "content": "<p>You're welcome.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 739851,
      "author_name": "syoya1997",
      "author_url": "",
      "post_date": "02/08/2020 13:48:44",
      "content": "<p>And you can also upload the <code>pretrained</code> package as a dataset and pip install it.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "737732": "Hi guys,\n\nBeing not allowed to use the internet on the submision kernel, I used pretrainedmodels as dataset and pip install it. So far, so good.\nThe bad part apears when I try to use a specific pretrained model with this sintax\n`model=pretrainedmodels.__dict__[pretrainedModelArhitecture](pretrained=pretrainedModelWeights).to(device)`\nThe kernels tries to connect to data.lip6.fr/cadene/pretrainedmodels/se_resnext101_32x4d-3b2fe3d8.pth to download the model and of course it cannot downloaded becose the internet is off.\nHow did you tackle this issue? you make a class where you define the whole resnext or whatever arhitecture do you want to use or you upload also this .pth file as dataset and if so how do you make it so it will search locally for it and not go online?\n\nThank you !",
    "737734": "Upload the pretrained weights to the dataset as well. Create your model with `pretrained=False` and load the weights with `load_state_dict`",
    "737836": "Worked like a charm, thanks @pestipeti !",
    "737840": "You're welcome.",
    "739851": "And you can also upload the `pretrained` package as a dataset and pip install it."
  },
  "source": "meta"
}