{
  "id": 206088,
  "title": "Install segmentation_models_pytorch without internet and use it in inference kernel ",
  "url": "/competitions/hubmap-kidney-segmentation/discussion/206088",
  "author_name": "",
  "post_date": "2020-12-23T07:17:50.944886Z",
  "votes": 26,
  "comment_count": 5,
  "views": 0,
  "content": "<p>As it is unable to use the internet on inference kernel we can upload wheel files for packages and install segmentation_models without internet.</p>\n<p>step1: Create a folder name \"wheels\" under /kaggle/working</p>\n<p>step2:  Enable internet and install segmentation models</p>\n<p><code>!pip install segmentation_models_pytorch</code></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2Fde0c11cd31c7fa10dfefbdd07e203157%2Fseg2.png?generation=1608707181039787&amp;alt=media\" alt=\"\"></p>\n<p>We can see that:</p>\n<p><code>Created wheel for efficientnet-pytorch: filename=efficientnet_pytorch-0.6.3-py3-none-any.whl size=12419 sha256=5f5b4d53944010f3422c7afde0885a97526fc353fb7e011c08a520bc3dad0b49\n  Stored in directory: /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a\n</code></p>\n<p>Copy the efficientnet_pytorch-0.6.3-py3-none-any.whl wheel to /kaggle/working/wheels</p>\n<p><code>!cp /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a/* /kaggle/working/wheels</code></p>\n<p>Similarly do the same for pretrainedmodels-0.7.4-py3-none-any.whl</p>\n<p>step3: We need more packages, timm-0.3.2-py3-none-any.whl and segmentation_models_pytorch-0.1.3-py3-none-any.whl</p>\n<p>For that,</p>\n<p><code>!pip download segmentation_models_pytorch</code></p>\n<p>This will download everything to /kaggle/working. Copy both wheel files to /kaggle/working/wheels.</p>\n<p>Now /kaggle/working/wheels contains the following wheels:</p>\n<ul>\n<li>timm-0.3.2-py3-none-any.whl</li>\n<li>efficientnet_pytorch-0.6.3-py3-none-any.whl</li>\n<li>pretrainedmodels-0.7.4-py3-none-any.whl</li>\n<li>segmentation_models_pytorch-0.1.3-py3-none-any.whl</li>\n</ul>\n<p>Download these wheel files and upload it as new dataset to your inference kernel. Now you can directly install from wheel files without internet</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2F74854efd1f5eb9d100bade40a4b4afec%2Fsegmentation_models.png?generation=1608708081273812&amp;alt=media\" alt=\"\"></p>\n<p>I have kept a dataset containing segmentation_model .whl files. You can use to for your inference.</p>\n<p>Dataset: <a href=\"https://www.kaggle.com/arunmohan003/segmentation-models-wheels\" target=\"_blank\">https://www.kaggle.com/arunmohan003/segmentation-models-wheels</a></p>\n<p>Note: This approach is applicable to any package if we want to use it without internet on Kaggle kernels.</p>",
  "messages": [
    {
      "id": "1123388",
      "postDate": "12/23/2020 07:17:50",
      "content": "<p>As it is unable to use the internet on inference kernel we can upload wheel files for packages and install segmentation_models without internet.</p>\n<p>step1: Create a folder name \"wheels\" under /kaggle/working</p>\n<p>step2:  Enable internet and install segmentation models</p>\n<p><code>!pip install segmentation_models_pytorch</code></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2Fde0c11cd31c7fa10dfefbdd07e203157%2Fseg2.png?generation=1608707181039787&amp;alt=media\" alt=\"\"></p>\n<p>We can see that:</p>\n<p><code>Created wheel for efficientnet-pytorch: filename=efficientnet_pytorch-0.6.3-py3-none-any.whl size=12419 sha256=5f5b4d53944010f3422c7afde0885a97526fc353fb7e011c08a520bc3dad0b49\n  Stored in directory: /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a\n</code></p>\n<p>Copy the efficientnet_pytorch-0.6.3-py3-none-any.whl wheel to /kaggle/working/wheels</p>\n<p><code>!cp /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a/* /kaggle/working/wheels</code></p>\n<p>Similarly do the same for pretrainedmodels-0.7.4-py3-none-any.whl</p>\n<p>step3: We need more packages, timm-0.3.2-py3-none-any.whl and segmentation_models_pytorch-0.1.3-py3-none-any.whl</p>\n<p>For that,</p>\n<p><code>!pip download segmentation_models_pytorch</code></p>\n<p>This will download everything to /kaggle/working. Copy both wheel files to /kaggle/working/wheels.</p>\n<p>Now /kaggle/working/wheels contains the following wheels:</p>\n<ul>\n<li>timm-0.3.2-py3-none-any.whl</li>\n<li>efficientnet_pytorch-0.6.3-py3-none-any.whl</li>\n<li>pretrainedmodels-0.7.4-py3-none-any.whl</li>\n<li>segmentation_models_pytorch-0.1.3-py3-none-any.whl</li>\n</ul>\n<p>Download these wheel files and upload it as new dataset to your inference kernel. Now you can directly install from wheel files without internet</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2F74854efd1f5eb9d100bade40a4b4afec%2Fsegmentation_models.png?generation=1608708081273812&amp;alt=media\" alt=\"\"></p>\n<p>I have kept a dataset containing segmentation_model .whl files. You can use to for your inference.</p>\n<p>Dataset: <a href=\"https://www.kaggle.com/arunmohan003/segmentation-models-wheels\" target=\"_blank\">https://www.kaggle.com/arunmohan003/segmentation-models-wheels</a></p>\n<p>Note: This approach is applicable to any package if we want to use it without internet on Kaggle kernels.</p>",
      "rawMarkdown": "As it is unable to use the internet on inference kernel we can upload wheel files for packages and install segmentation_models without internet.\n\nstep1: Create a folder name \"wheels\" under /kaggle/working\n\nstep2:  Enable internet and install segmentation models\n\n`!pip install segmentation_models_pytorch`\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2Fde0c11cd31c7fa10dfefbdd07e203157%2Fseg2.png?generation=1608707181039787&alt=media)\n\nWe can see that:\n\n` Created wheel for efficientnet-pytorch: filename=efficientnet_pytorch-0.6.3-py3-none-any.whl size=12419 sha256=5f5b4d53944010f3422c7afde0885a97526fc353fb7e011c08a520bc3dad0b49\n  Stored in directory: /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a\n`\n\nCopy the efficientnet_pytorch-0.6.3-py3-none-any.whl wheel to /kaggle/working/wheels\n\n`!cp /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a/* /kaggle/working/wheels`\n\nSimilarly do the same for pretrainedmodels-0.7.4-py3-none-any.whl\n\n\nstep3: We need more packages, timm-0.3.2-py3-none-any.whl and segmentation_models_pytorch-0.1.3-py3-none-any.whl\n\nFor that,\n\n`!pip download segmentation_models_pytorch`\n\nThis will download everything to /kaggle/working. Copy both wheel files to /kaggle/working/wheels.\n\nNow /kaggle/working/wheels contains the following wheels:\n\n- timm-0.3.2-py3-none-any.whl\n- efficientnet_pytorch-0.6.3-py3-none-any.whl\n- pretrainedmodels-0.7.4-py3-none-any.whl\n- segmentation_models_pytorch-0.1.3-py3-none-any.whl\n\nDownload these wheel files and upload it as new dataset to your inference kernel. Now you can directly install from wheel files without internet\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2F74854efd1f5eb9d100bade40a4b4afec%2Fsegmentation_models.png?generation=1608708081273812&alt=media)\n\n\nI have kept a dataset containing segmentation_model .whl files. You can use to for your inference.\n\nDataset: https://www.kaggle.com/arunmohan003/segmentation-models-wheels\n\nNote: This approach is applicable to any package if we want to use it without internet on Kaggle kernels.",
      "votes": null
    },
    {
      "id": "1124577",
      "postDate": "12/24/2020 04:12:06",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/arunmohan003\" target=\"_blank\">@arunmohan003</a> , The steps are very clear and its easy to understand. Very clean.<br>\nThanks for sharing this 👍😄</p>",
      "rawMarkdown": "Hi @arunmohan003 , The steps are very clear and its easy to understand. Very clean.\nThanks for sharing this 👍😄",
      "votes": null
    },
    {
      "id": "1124696",
      "postDate": "12/24/2020 06:28:47",
      "content": "<p>cool…..!</p>",
      "rawMarkdown": "cool.....!",
      "votes": null
    },
    {
      "id": "1145457",
      "postDate": "01/09/2021 06:42:46",
      "content": "<p>Nice <a href=\"https://www.kaggle.com/arunmohan003\" target=\"_blank\">@arunmohan003</a> </p>",
      "rawMarkdown": "Nice @arunmohan003",
      "votes": null
    },
    {
      "id": "1256115",
      "postDate": "03/29/2021 14:54:53",
      "content": "<p>Thx for sharing!</p>",
      "rawMarkdown": "Thx for sharing!",
      "votes": null
    },
    {
      "id": "1613151",
      "postDate": "12/09/2021 17:04:01",
      "content": "<p>Hi , </p>\n<p>I have updated segmentation_model_wheels as the library was updated. Please refer the new wheels for installation here:<br>\n<a href=\"https://www.kaggle.com/arunmohan003/segmentation-models-pytorch-021\" target=\"_blank\">https://www.kaggle.com/arunmohan003/segmentation-models-pytorch-021</a></p>",
      "rawMarkdown": "Hi , \n\nI have updated segmentation_model_wheels as the library was updated. Please refer the new wheels for installation here:\nhttps://www.kaggle.com/arunmohan003/segmentation-models-pytorch-021",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1124577,
      "author_name": "utkarshxy",
      "author_url": "",
      "post_date": "12/24/2020 04:12:06",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/arunmohan003\" target=\"_blank\">@arunmohan003</a> , The steps are very clear and its easy to understand. Very clean.<br>\nThanks for sharing this 👍😄</p>",
      "votes": null,
      "replies": [
        {
          "id": 1124696,
          "author_name": "arunmohan003",
          "author_url": "",
          "post_date": "12/24/2020 06:28:47",
          "content": "<p>cool…..!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1145457,
      "author_name": "hackspyder",
      "author_url": "",
      "post_date": "01/09/2021 06:42:46",
      "content": "<p>Nice <a href=\"https://www.kaggle.com/arunmohan003\" target=\"_blank\">@arunmohan003</a> </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1256115,
      "author_name": "lrchan",
      "author_url": "",
      "post_date": "03/29/2021 14:54:53",
      "content": "<p>Thx for sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1613151,
      "author_name": "arunmohan003",
      "author_url": "",
      "post_date": "12/09/2021 17:04:01",
      "content": "<p>Hi , </p>\n<p>I have updated segmentation_model_wheels as the library was updated. Please refer the new wheels for installation here:<br>\n<a href=\"https://www.kaggle.com/arunmohan003/segmentation-models-pytorch-021\" target=\"_blank\">https://www.kaggle.com/arunmohan003/segmentation-models-pytorch-021</a></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1123388": "As it is unable to use the internet on inference kernel we can upload wheel files for packages and install segmentation_models without internet.\n\nstep1: Create a folder name \"wheels\" under /kaggle/working\n\nstep2:  Enable internet and install segmentation models\n\n`!pip install segmentation_models_pytorch`\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2Fde0c11cd31c7fa10dfefbdd07e203157%2Fseg2.png?generation=1608707181039787&alt=media)\n\nWe can see that:\n\n` Created wheel for efficientnet-pytorch: filename=efficientnet_pytorch-0.6.3-py3-none-any.whl size=12419 sha256=5f5b4d53944010f3422c7afde0885a97526fc353fb7e011c08a520bc3dad0b49\n  Stored in directory: /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a\n`\n\nCopy the efficientnet_pytorch-0.6.3-py3-none-any.whl wheel to /kaggle/working/wheels\n\n`!cp /root/.cache/pip/wheels/90/6b/0c/f0ad36d00310e65390b0d4c9218ae6250ac579c92540c9097a/* /kaggle/working/wheels`\n\nSimilarly do the same for pretrainedmodels-0.7.4-py3-none-any.whl\n\n\nstep3: We need more packages, timm-0.3.2-py3-none-any.whl and segmentation_models_pytorch-0.1.3-py3-none-any.whl\n\nFor that,\n\n`!pip download segmentation_models_pytorch`\n\nThis will download everything to /kaggle/working. Copy both wheel files to /kaggle/working/wheels.\n\nNow /kaggle/working/wheels contains the following wheels:\n\n- timm-0.3.2-py3-none-any.whl\n- efficientnet_pytorch-0.6.3-py3-none-any.whl\n- pretrainedmodels-0.7.4-py3-none-any.whl\n- segmentation_models_pytorch-0.1.3-py3-none-any.whl\n\nDownload these wheel files and upload it as new dataset to your inference kernel. Now you can directly install from wheel files without internet\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4019528%2F74854efd1f5eb9d100bade40a4b4afec%2Fsegmentation_models.png?generation=1608708081273812&alt=media)\n\n\nI have kept a dataset containing segmentation_model .whl files. You can use to for your inference.\n\nDataset: https://www.kaggle.com/arunmohan003/segmentation-models-wheels\n\nNote: This approach is applicable to any package if we want to use it without internet on Kaggle kernels.",
    "1124577": "Hi @arunmohan003 , The steps are very clear and its easy to understand. Very clean.\nThanks for sharing this 👍😄",
    "1124696": "cool.....!",
    "1145457": "Nice @arunmohan003",
    "1256115": "Thx for sharing!",
    "1613151": "Hi , \n\nI have updated segmentation_model_wheels as the library was updated. Please refer the new wheels for installation here:\nhttps://www.kaggle.com/arunmohan003/segmentation-models-pytorch-021"
  },
  "source": "meta"
}