{
  "id": 348057,
  "title": "How to easily import `segmentation_models_pytorch` without Internet connection!",
  "url": "/competitions/hubmap-organ-segmentation/discussion/348057",
  "author_name": "",
  "post_date": "2022-08-26T16:47:40.902130200Z",
  "votes": 13,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Today, I have trained several baseline models with <code>segmentation_models_pytorch</code> library, but when the deal came to Inferencing with Internet-off, it was really problem. Despite this, there were a lot of published notebooks, which show how to import <code>segmentation_models_pytorch</code>, but there is one big problem, it takes a ton of lines of code and time to write and install packages through their wheels respectively. So, I provide a clean and the main faster solution on how to import <code>segmentation_models_pytorch</code>. </p>\n<p>Add these datasets to your inference or training notebook: </p>\n<ul>\n<li>EfficientNet PyTorch: <a href=\"https://www.kaggle.com/datasets/vad13irt/efficientnet-pytorch\" target=\"_blank\">https://www.kaggle.com/datasets/vad13irt/efficientnet-pytorch</a></li>\n<li>Pre-trained Models PyTorch: <a href=\"https://www.kaggle.com/datasets/vad13irt/pretrained-models-pytorch\" target=\"_blank\">https://www.kaggle.com/datasets/vad13irt/pretrained-models-pytorch</a></li>\n<li>timm (PyTorch Image Models): <a href=\"https://www.kaggle.com/datasets/kozodoi/timm-pytorch-image-models\" target=\"_blank\">https://www.kaggle.com/datasets/kozodoi/timm-pytorch-image-models</a></li>\n<li>Segmentation Models PyTorch: <a href=\"https://www.kaggle.com/datasets/vad13irt/segmentation-models-pytorch\" target=\"_blank\">https://www.kaggle.com/datasets/vad13irt/segmentation-models-pytorch</a></li>\n</ul>\n<p>Then, run these lines of code:</p>\n<pre><code>import sys\nsys.path.append(\"../input/timm-pytorch-image-models/pytorch-image-models-master\")\nsys.path.append(\"../input/pretrained-models-pytorch\")\nsys.path.append(\"../input/efficientnet-pytorch\")\nsys.path.append(\"../input/segmentation-models-pytorch\")\nimport segmentation_models_pytorch as smp\n\n\nprint(f\"Segmentation Models version: {smp.__version__}\")\n</code></pre>\n<p>And, voila! Enjoy!</p>\n<p>Additionally, I published a notebook with this to make sure that I am not laying: <a href=\"https://www.kaggle.com/code/vad13irt/segmentation-models-pytorch-installation\" target=\"_blank\">https://www.kaggle.com/code/vad13irt/segmentation-models-pytorch-installation</a></p>",
  "messages": [
    {
      "id": "1915086",
      "postDate": "08/26/2022 16:47:40",
      "content": "<p>Today, I have trained several baseline models with <code>segmentation_models_pytorch</code> library, but when the deal came to Inferencing with Internet-off, it was really problem. Despite this, there were a lot of published notebooks, which show how to import <code>segmentation_models_pytorch</code>, but there is one big problem, it takes a ton of lines of code and time to write and install packages through their wheels respectively. So, I provide a clean and the main faster solution on how to import <code>segmentation_models_pytorch</code>. </p>\n<p>Add these datasets to your inference or training notebook: </p>\n<ul>\n<li>EfficientNet PyTorch: <a href=\"https://www.kaggle.com/datasets/vad13irt/efficientnet-pytorch\" target=\"_blank\">https://www.kaggle.com/datasets/vad13irt/efficientnet-pytorch</a></li>\n<li>Pre-trained Models PyTorch: <a href=\"https://www.kaggle.com/datasets/vad13irt/pretrained-models-pytorch\" target=\"_blank\">https://www.kaggle.com/datasets/vad13irt/pretrained-models-pytorch</a></li>\n<li>timm (PyTorch Image Models): <a href=\"https://www.kaggle.com/datasets/kozodoi/timm-pytorch-image-models\" target=\"_blank\">https://www.kaggle.com/datasets/kozodoi/timm-pytorch-image-models</a></li>\n<li>Segmentation Models PyTorch: <a href=\"https://www.kaggle.com/datasets/vad13irt/segmentation-models-pytorch\" target=\"_blank\">https://www.kaggle.com/datasets/vad13irt/segmentation-models-pytorch</a></li>\n</ul>\n<p>Then, run these lines of code:</p>\n<pre><code>import sys\nsys.path.append(\"../input/timm-pytorch-image-models/pytorch-image-models-master\")\nsys.path.append(\"../input/pretrained-models-pytorch\")\nsys.path.append(\"../input/efficientnet-pytorch\")\nsys.path.append(\"../input/segmentation-models-pytorch\")\nimport segmentation_models_pytorch as smp\n\n\nprint(f\"Segmentation Models version: {smp.__version__}\")\n</code></pre>\n<p>And, voila! Enjoy!</p>\n<p>Additionally, I published a notebook with this to make sure that I am not laying: <a href=\"https://www.kaggle.com/code/vad13irt/segmentation-models-pytorch-installation\" target=\"_blank\">https://www.kaggle.com/code/vad13irt/segmentation-models-pytorch-installation</a></p>",
      "rawMarkdown": "Today, I have trained several baseline models with `segmentation_models_pytorch` library, but when the deal came to Inferencing with Internet-off, it was really problem. Despite this, there were a lot of published notebooks, which show how to import `segmentation_models_pytorch`, but there is one big problem, it takes a ton of lines of code and time to write and install packages through their wheels respectively. So, I provide a clean and the main faster solution on how to import `segmentation_models_pytorch`. \n\nAdd these datasets to your inference or training notebook: \n- EfficientNet PyTorch: https://www.kaggle.com/datasets/vad13irt/efficientnet-pytorch\n- Pre-trained Models PyTorch: https://www.kaggle.com/datasets/vad13irt/pretrained-models-pytorch\n- timm (PyTorch Image Models): https://www.kaggle.com/datasets/kozodoi/timm-pytorch-image-models\n- Segmentation Models PyTorch: https://www.kaggle.com/datasets/vad13irt/segmentation-models-pytorch\n\nThen, run these lines of code:\n\n```\nimport sys\nsys.path.append(\"../input/timm-pytorch-image-models/pytorch-image-models-master\")\nsys.path.append(\"../input/pretrained-models-pytorch\")\nsys.path.append(\"../input/efficientnet-pytorch\")\nsys.path.append(\"../input/segmentation-models-pytorch\")\nimport segmentation_models_pytorch as smp\n\n\nprint(f\"Segmentation Models version: {smp.__version__}\")\n\n```\n\nAnd, voila! Enjoy!\n\nAdditionally, I published a notebook with this to make sure that I am not laying: https://www.kaggle.com/code/vad13irt/segmentation-models-pytorch-installation",
      "votes": null
    },
    {
      "id": "1918761",
      "postDate": "08/29/2022 20:25:41",
      "content": "<p><a href=\"https://www.kaggle.com/vad13irt\" target=\"_blank\">@vad13irt</a> 👍👍</p>",
      "rawMarkdown": "vad13irt 👍👍",
      "votes": null
    },
    {
      "id": "1918853",
      "postDate": "08/29/2022 22:56:01",
      "content": "<p>Can't be faster than this 👍 Thanks! </p>",
      "rawMarkdown": "Can't be faster than this 👍 Thanks!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1918761,
      "author_name": "kartushovdanil",
      "author_url": "",
      "post_date": "08/29/2022 20:25:41",
      "content": "<p><a href=\"https://www.kaggle.com/vad13irt\" target=\"_blank\">@vad13irt</a> 👍👍</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1918853,
      "author_name": "kirderf",
      "author_url": "",
      "post_date": "08/29/2022 22:56:01",
      "content": "<p>Can't be faster than this 👍 Thanks! </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1915086": "Today, I have trained several baseline models with `segmentation_models_pytorch` library, but when the deal came to Inferencing with Internet-off, it was really problem. Despite this, there were a lot of published notebooks, which show how to import `segmentation_models_pytorch`, but there is one big problem, it takes a ton of lines of code and time to write and install packages through their wheels respectively. So, I provide a clean and the main faster solution on how to import `segmentation_models_pytorch`. \n\nAdd these datasets to your inference or training notebook: \n- EfficientNet PyTorch: https://www.kaggle.com/datasets/vad13irt/efficientnet-pytorch\n- Pre-trained Models PyTorch: https://www.kaggle.com/datasets/vad13irt/pretrained-models-pytorch\n- timm (PyTorch Image Models): https://www.kaggle.com/datasets/kozodoi/timm-pytorch-image-models\n- Segmentation Models PyTorch: https://www.kaggle.com/datasets/vad13irt/segmentation-models-pytorch\n\nThen, run these lines of code:\n\n```\nimport sys\nsys.path.append(\"../input/timm-pytorch-image-models/pytorch-image-models-master\")\nsys.path.append(\"../input/pretrained-models-pytorch\")\nsys.path.append(\"../input/efficientnet-pytorch\")\nsys.path.append(\"../input/segmentation-models-pytorch\")\nimport segmentation_models_pytorch as smp\n\n\nprint(f\"Segmentation Models version: {smp.__version__}\")\n\n```\n\nAnd, voila! Enjoy!\n\nAdditionally, I published a notebook with this to make sure that I am not laying: https://www.kaggle.com/code/vad13irt/segmentation-models-pytorch-installation",
    "1918761": "vad13irt 👍👍",
    "1918853": "Can't be faster than this 👍 Thanks!"
  },
  "source": "meta"
}