{
  "id": 343470,
  "title": "How do we bring 400GB of data?",
  "url": "/competitions/mayo-clinic-strip-ai/discussion/343470",
  "author_name": "min fuka",
  "post_date": "2022-08-11T11:37:37.964000",
  "votes": 13,
  "comment_count": 6,
  "views": 0,
  "content": "<p>There are 400GB with train data, test data and other data. I would like to work with Colab but could not figure out how to do it. Fortunately, the following site explains how to mount (sorry for the Japanese).</p>\n<p><a href=\"https://slash-z.com/google-colab-mount-kaggle-competition-dataset/\" target=\"_blank\">https://slash-z.com/google-colab-mount-kaggle-competition-dataset/</a></p>\n<p>The outline is</p>\n<p>①Open new notebokk in kaggle_notebook and display GCS path in kaggle_notebook.</p>\n<p>from kaggle_datasets import KaggleDatasets<br>\nKaggleDatasets().get_gcs_path()</p>\n<p>gs://{path-name}</p>\n<p>②Start colab and allow authentication of Google Cloud SDK via web browser.</p>\n<p>from google.colab import auth<br>\nauth.authenticate_user()</p>\n<p>Paste the authentication code copied above into the colab blank and enter to authenticate.</p>\n<p>③ GPG key acquisition / Google Cloud Strage FUSE installation in colab environment.</p>\n<p>!echo \"deb <a href=\"http://packages.cloud.google.com/apt\" target=\"_blank\">http://packages.cloud.google.com/apt</a> gcsfuse-<code>lsb_release -c -s</code> main\" | sudo tee /etc/apt/sources.list.d/gcsfuse.list<br>\n!curl <a href=\"https://packages.cloud.google.com/apt/doc/apt-key.gpg\" target=\"_blank\">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a> | sudo apt-key add -<br>\n!apt-get -y -q update<br>\n!apt-get -y -q install gcsfuse</p>\n<p>④ Create a directory for mount with any name you like / mount the GCS path with the directory you just created using the gscfuse command.</p>\n<p>!mkdir -p tmp<br>\n!gcsfuse --implicit-dirs --limit-bytes-per-sec -1 --limit-ops-per-sec -1 \"｛①path-name｝\" tmp</p>",
  "messages": [
    {
      "id": 1894292,
      "postDate": "2022-08-11T11:37:37.963Z",
      "content": "<p>There are 400GB with train data, test data and other data. I would like to work with Colab but could not figure out how to do it. Fortunately, the following site explains how to mount (sorry for the Japanese).</p>\n<p><a href=\"https://slash-z.com/google-colab-mount-kaggle-competition-dataset/\" target=\"_blank\">https://slash-z.com/google-colab-mount-kaggle-competition-dataset/</a></p>\n<p>The outline is</p>\n<p>①Open new notebokk in kaggle_notebook and display GCS path in kaggle_notebook.</p>\n<p>from kaggle_datasets import KaggleDatasets<br>\nKaggleDatasets().get_gcs_path()</p>\n<p>gs://{path-name}</p>\n<p>②Start colab and allow authentication of Google Cloud SDK via web browser.</p>\n<p>from google.colab import auth<br>\nauth.authenticate_user()</p>\n<p>Paste the authentication code copied above into the colab blank and enter to authenticate.</p>\n<p>③ GPG key acquisition / Google Cloud Strage FUSE installation in colab environment.</p>\n<p>!echo \"deb <a href=\"http://packages.cloud.google.com/apt\" target=\"_blank\">http://packages.cloud.google.com/apt</a> gcsfuse-<code>lsb_release -c -s</code> main\" | sudo tee /etc/apt/sources.list.d/gcsfuse.list<br>\n!curl <a href=\"https://packages.cloud.google.com/apt/doc/apt-key.gpg\" target=\"_blank\">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a> | sudo apt-key add -<br>\n!apt-get -y -q update<br>\n!apt-get -y -q install gcsfuse</p>\n<p>④ Create a directory for mount with any name you like / mount the GCS path with the directory you just created using the gscfuse command.</p>\n<p>!mkdir -p tmp<br>\n!gcsfuse --implicit-dirs --limit-bytes-per-sec -1 --limit-ops-per-sec -1 \"｛①path-name｝\" tmp</p>",
      "rawMarkdown": "There are 400GB with train data, test data and other data. I would like to work with Colab but could not figure out how to do it. Fortunately, the following site explains how to mount (sorry for the Japanese).\n\nhttps://slash-z.com/google-colab-mount-kaggle-competition-dataset/\n\nThe outline is\n\n ①Open new notebokk in kaggle_notebook and display GCS path in kaggle_notebook.\n\nfrom kaggle_datasets import KaggleDatasets\nKaggleDatasets().get_gcs_path()\n\ngs://{path-name}\n\n②Start colab and allow authentication of Google Cloud SDK via web browser.\n\nfrom google.colab import auth\nauth.authenticate_user()\n\nPaste the authentication code copied above into the colab blank and enter to authenticate.\n\n③ GPG key acquisition / Google Cloud Strage FUSE installation in colab environment.\n\n!echo \"deb http://packages.cloud.google.com/apt gcsfuse-`lsb_release -c -s` main\" | sudo tee /etc/apt/sources.list.d/gcsfuse.list\n!curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -\n!apt-get -y -q update\n!apt-get -y -q install gcsfuse\n\n④ Create a directory for mount with any name you like / mount the GCS path with the directory you just created using the gscfuse command.\n\n!mkdir -p tmp\n!gcsfuse --implicit-dirs --limit-bytes-per-sec -1 --limit-ops-per-sec -1 \"｛①path-name｝\" tmp",
      "votes": 13
    },
    {
      "id": 1921485,
      "postDate": "2022-08-31T21:43:53.263Z",
      "content": "<p>I wonder what could be the benefit of using Colab vs Kaggle?<br>\nDid you do any benchmarks on how fast is it loading images in colab vs kaggle? e.g. how long does it take to load one image in each environment.</p>",
      "rawMarkdown": "I wonder what could be the benefit of using Colab vs Kaggle?\nDid you do any benchmarks on how fast is it loading images in colab vs kaggle? e.g. how long does it take to load one image in each environment.",
      "votes": 1,
      "replies": [
        {
          "id": 1921952,
          "postDate": "2022-09-01T07:05:22.103Z",
          "content": "<p>As I know there is a restriction to use your GPU in Kaggle. You can use it some extent but if you use your own environment it will help you to use it as long as you want. If you wonder why GPU is matter, GPU makes you to train your models with better performance than your CPU (which is default in Kaggle).</p>",
          "rawMarkdown": "As I know there is a restriction to use your GPU in Kaggle. You can use it some extent but if you use your own environment it will help you to use it as long as you want. If you wonder why GPU is matter, GPU makes you to train your models with better performance than your CPU (which is default in Kaggle).",
          "votes": 1
        },
        {
          "id": 1922800,
          "postDate": "2022-09-01T18:03:16.273Z",
          "content": "<p>the question is how fast do you load the image in both environment, cause for instance if it is 10x slower to load an image, the training will be just frustrating. Also even with Colab, there is a limitation you can't indefinitely use GPU unless they removed this restriction recently.</p>",
          "rawMarkdown": "the question is how fast do you load the image in both environment, cause for instance if it is 10x slower to load an image, the training will be just frustrating. Also even with Colab, there is a limitation you can't indefinitely use GPU unless they removed this restriction recently.",
          "votes": 1
        },
        {
          "id": 1923127,
          "postDate": "2022-09-02T02:41:26.450Z",
          "content": "<p>Thanks for your question.</p>\n<p>As Ahmet Çalış said, the reason for using Colab is Kaggle's GPU usage time limit.</p>\n<p>As for loading images, the transfer speed between Colab and Kaggle is faster than I expected.<br>\nI used<br>\n<a href=\"https://www.kaggle.com/code/yasufuminakama/mayo-train-images-size-1024-n-16-1\" target=\"_blank\">https://www.kaggle.com/code/yasufuminakama/mayo-train-images-size-1024-n-16-1</a><br>\nnotebook with input files mounted from Kaggle and run in Colab.<br>\nIn Y.NAKAMA's run, the processing time was 1 hour and 13 minutes for 100 images, and when I ran it with Colab, the processing time was 42 minutes.</p>",
          "rawMarkdown": "Thanks for your question.\n\nAs Ahmet Çalış said, the reason for using Colab is Kaggle's GPU usage time limit.\n\nAs for loading images, the transfer speed between Colab and Kaggle is faster than I expected.\nI used\nhttps://www.kaggle.com/code/yasufuminakama/mayo-train-images-size-1024-n-16-1\nnotebook with input files mounted from Kaggle and run in Colab.\nIn Y.NAKAMA's run, the processing time was 1 hour and 13 minutes for 100 images, and when I ran it with Colab, the processing time was 42 minutes."
        }
      ]
    },
    {
      "id": 1924338,
      "postDate": "2022-09-03T01:18:15.380Z",
      "content": "<p>I tried this, but the tmp folder was empty by the end.</p>",
      "rawMarkdown": "I tried this, but the tmp folder was empty by the end.",
      "replies": [
        {
          "id": 1924650,
          "postDate": "2022-09-03T09:14:17.597Z",
          "content": "<p>GCS path may be updated.<br>\nPlease check the GCS path in the Kaggle notebook before mounting to Colab. In my case, it was different from the last time. Using the latest GCS path, I was able to mount as shown in the figure.<br>\n(I changed the mount destination to input/mayo-clinic-strip-ai instead of tmp)</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8234844%2F5565efe329cb833af7dc07a4fa8e9e06%2FScreenshot%20from%202022-09-03%2018-07-07.png?generation=1662196390916631&amp;alt=media\" alt=\"\"></p>",
          "rawMarkdown": "GCS path may be updated.\nPlease check the GCS path in the Kaggle notebook before mounting to Colab. In my case, it was different from the last time. Using the latest GCS path, I was able to mount as shown in the figure.\n(I changed the mount destination to input/mayo-clinic-strip-ai instead of tmp)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8234844%2F5565efe329cb833af7dc07a4fa8e9e06%2FScreenshot%20from%202022-09-03%2018-07-07.png?generation=1662196390916631&alt=media)"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1921485,
      "author_name": "bachir",
      "author_url": "",
      "post_date": "2022-08-31T21:43:53.263000",
      "content": "<p>I wonder what could be the benefit of using Colab vs Kaggle?<br>\nDid you do any benchmarks on how fast is it loading images in colab vs kaggle? e.g. how long does it take to load one image in each environment.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1921952,
          "author_name": "Ahmet Çalış",
          "author_url": "",
          "post_date": "2022-09-01T07:05:22.103000",
          "content": "<p>As I know there is a restriction to use your GPU in Kaggle. You can use it some extent but if you use your own environment it will help you to use it as long as you want. If you wonder why GPU is matter, GPU makes you to train your models with better performance than your CPU (which is default in Kaggle).</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1922800,
          "author_name": "bachir",
          "author_url": "",
          "post_date": "2022-09-01T18:03:16.273000",
          "content": "<p>the question is how fast do you load the image in both environment, cause for instance if it is 10x slower to load an image, the training will be just frustrating. Also even with Colab, there is a limitation you can't indefinitely use GPU unless they removed this restriction recently.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1923127,
          "author_name": "min fuka",
          "author_url": "",
          "post_date": "2022-09-02T02:41:26.450000",
          "content": "<p>Thanks for your question.</p>\n<p>As Ahmet Çalış said, the reason for using Colab is Kaggle's GPU usage time limit.</p>\n<p>As for loading images, the transfer speed between Colab and Kaggle is faster than I expected.<br>\nI used<br>\n<a href=\"https://www.kaggle.com/code/yasufuminakama/mayo-train-images-size-1024-n-16-1\" target=\"_blank\">https://www.kaggle.com/code/yasufuminakama/mayo-train-images-size-1024-n-16-1</a><br>\nnotebook with input files mounted from Kaggle and run in Colab.<br>\nIn Y.NAKAMA's run, the processing time was 1 hour and 13 minutes for 100 images, and when I ran it with Colab, the processing time was 42 minutes.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1924338,
      "author_name": "Daniel Macaulay",
      "author_url": "",
      "post_date": "2022-09-03T01:18:15.380000",
      "content": "<p>I tried this, but the tmp folder was empty by the end.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1924650,
          "author_name": "min fuka",
          "author_url": "",
          "post_date": "2022-09-03T09:14:17.597000",
          "content": "<p>GCS path may be updated.<br>\nPlease check the GCS path in the Kaggle notebook before mounting to Colab. In my case, it was different from the last time. Using the latest GCS path, I was able to mount as shown in the figure.<br>\n(I changed the mount destination to input/mayo-clinic-strip-ai instead of tmp)</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8234844%2F5565efe329cb833af7dc07a4fa8e9e06%2FScreenshot%20from%202022-09-03%2018-07-07.png?generation=1662196390916631&amp;alt=media\" alt=\"\"></p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1894292": "There are 400GB with train data, test data and other data. I would like to work with Colab but could not figure out how to do it. Fortunately, the following site explains how to mount (sorry for the Japanese).\n\nhttps://slash-z.com/google-colab-mount-kaggle-competition-dataset/\n\nThe outline is\n\n ①Open new notebokk in kaggle_notebook and display GCS path in kaggle_notebook.\n\nfrom kaggle_datasets import KaggleDatasets\nKaggleDatasets().get_gcs_path()\n\ngs://{path-name}\n\n②Start colab and allow authentication of Google Cloud SDK via web browser.\n\nfrom google.colab import auth\nauth.authenticate_user()\n\nPaste the authentication code copied above into the colab blank and enter to authenticate.\n\n③ GPG key acquisition / Google Cloud Strage FUSE installation in colab environment.\n\n!echo \"deb http://packages.cloud.google.com/apt gcsfuse-`lsb_release -c -s` main\" | sudo tee /etc/apt/sources.list.d/gcsfuse.list\n!curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -\n!apt-get -y -q update\n!apt-get -y -q install gcsfuse\n\n④ Create a directory for mount with any name you like / mount the GCS path with the directory you just created using the gscfuse command.\n\n!mkdir -p tmp\n!gcsfuse --implicit-dirs --limit-bytes-per-sec -1 --limit-ops-per-sec -1 \"｛①path-name｝\" tmp",
    "1921485": "I wonder what could be the benefit of using Colab vs Kaggle?\nDid you do any benchmarks on how fast is it loading images in colab vs kaggle? e.g. how long does it take to load one image in each environment.",
    "1924338": "I tried this, but the tmp folder was empty by the end."
  }
}