{
  "id": 229962,
  "title": "The problem with using GoogleColab(GoogleDrive)",
  "url": "/competitions/hpa-single-cell-image-classification/discussion/229962",
  "author_name": "tsujino",
  "post_date": "2021-04-01T12:32:56.965000",
  "votes": 2,
  "comment_count": 9,
  "views": 0,
  "content": "<p>When I download dataset to google drive by API command and try to unzip those zip files, some of those data will be missing.<br>\nI'm using <code>unzip</code> command, on colab notebook.<br>\nI can confirm that unzipping is working on colab, but I can't see some of the data on drive.<br>\n(I'm colab pro user and subscribe 200GB strage.)</p>\n<p>Does anyone know how to solve it?<br>\nIs anyone else using colab without problems?</p>\n<hr>\n<p>P.S.<br>\nIt may just be a slow reflection on google drive.<br>\nI checked after a while and the data showed up fine.</p>",
  "messages": [
    {
      "id": 1303220,
      "postDate": "2021-05-12T01:12:14.213Z",
      "content": "<p><a href=\"https://www.kaggle.com/tt0721\" target=\"_blank\">@tt0721</a> </p>\n<p>Great job bronze :))))</p>\n<p>You must be very good in google colab now :)</p>",
      "rawMarkdown": "@tt0721 \n\nGreat job bronze :))))\n\nYou must be very good in google colab now :)",
      "votes": 1,
      "replies": [
        {
          "id": 1304953,
          "postDate": "2021-05-13T03:00:46.270Z",
          "content": "<p>Thanks! it's thanks to your advice:)<br>\nGreat job bronze, you too!</p>",
          "rawMarkdown": "Thanks! it's thanks to your advice:)\nGreat job bronze, you too!"
        }
      ]
    },
    {
      "id": 1260202,
      "postDate": "2021-04-01T23:32:55.637Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/tt0721\" target=\"_blank\">@tt0721</a> </p>\n<p>You don't need to download the dataset to your google drive.</p>\n<p>The dataset already in Google Cloud Storage, I used it for GPU and of course TPU </p>\n<p>see this comment from <a href=\"https://www.kaggle.com/mgornergoogle\" target=\"_blank\">@mgornergoogle</a></p>\n<p>\"To access the data, run KaggleDatasets().get_gcs_path() on Kaggle once. It will return a GCS bucket name like 'gs://xyz12234567890'. That's where Kaggle stores the attached dataset.\"</p>\n<p><a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130194\" target=\"_blank\">https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130194</a></p>\n<p>So You can find the path using this code:</p>\n<p>path_gcs = KaggleDatasets().get_gcs_path('hpa-single-cell-image-classification')<br>\nprint(path_gcs)</p>\n<p>See here :<br>\n<a href=\"https://www.kaggle.com/drcapa/human-protein-atlas-tpu-tutorial\" target=\"_blank\">https://www.kaggle.com/drcapa/human-protein-atlas-tpu-tutorial</a></p>\n<p>All the best </p>",
      "rawMarkdown": "Hi @tt0721 \n\nYou don't need to download the dataset to your google drive.\n\nThe dataset already in Google Cloud Storage, I used it for GPU and of course TPU \n\nsee this comment from @mgornergoogle\n\n\"To access the data, run KaggleDatasets().get_gcs_path() on Kaggle once. It will return a GCS bucket name like 'gs://xyz12234567890'. That's where Kaggle stores the attached dataset.\"\n\nhttps://www.kaggle.com/c/flower-classification-with-tpus/discussion/130194\n\n\nSo You can find the path using this code:\n\npath_gcs = KaggleDatasets().get_gcs_path('hpa-single-cell-image-classification')\nprint(path_gcs)\n\nSee here :\nhttps://www.kaggle.com/drcapa/human-protein-atlas-tpu-tutorial\n\nAll the best ",
      "votes": 1,
      "replies": [
        {
          "id": 1260342,
          "postDate": "2021-04-02T03:23:25.643Z",
          "content": "<p>Very helpful! I'll try it!<br>\nThank you very much!</p>",
          "rawMarkdown": "Very helpful! I'll try it!\nThank you very much!",
          "votes": 1
        },
        {
          "id": 1261402,
          "postDate": "2021-04-03T03:48:37.287Z",
          "content": "<p>Hi, <a href=\"https://www.kaggle.com/faisalalsrheed\" target=\"_blank\">@faisalalsrheed</a><br>\nSorry for the newbie question, but please let me know if you can.</p>\n<p>When using GPU, is it possible to load data from GCS directly onto colab? <br>\nOr do I need to copy it to Drive once?</p>\n<p>I was able to get the bucket name, but I don't know what to do from there.<br>\nI've never used TPU before, so the explanation in the link you provided is not very clear for me:(<br>\nThanks!</p>",
          "rawMarkdown": "Hi, @faisalalsrheed\nSorry for the newbie question, but please let me know if you can.\n\nWhen using GPU, is it possible to load data from GCS directly onto colab? \nOr do I need to copy it to Drive once?\n\nI was able to get the bucket name, but I don't know what to do from there.\nI've never used TPU before, so the explanation in the link you provided is not very clear for me:(\nThanks!"
        },
        {
          "id": 1261972,
          "postDate": "2021-04-03T16:29:56.770Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/tt0721\" target=\"_blank\">@tt0721</a>, </p>\n<p>It is my pleasure 🙂</p>\n<p>I am learning too about using Google Colab for Kaggle. <br>\nIt is an important skill to have when you do many competitions at the same time.</p>\n<p>You can see here how I used it for past competitions ( it work with GPU and TPU)<br>\n<a href=\"https://colab.research.google.com/drive/1tb73j5SB9oryTZsPGvH2I7rhPrvPUJcV?usp=sharing\" target=\"_blank\">https://colab.research.google.com/drive/1tb73j5SB9oryTZsPGvH2I7rhPrvPUJcV?usp=sharing</a></p>\n<p>Here you can find another way to do it:<br>\n<a href=\"https://www.kaggle.com/amyjang/tensorflow-pneumonia-classification-on-x-rays\" target=\"_blank\">https://www.kaggle.com/amyjang/tensorflow-pneumonia-classification-on-x-rays</a></p>\n<p>see this part of the code :</p>\n<pre><code>filenames = tf.io.gfile.glob(str(GCS_PATH + '/chest_xray/train/*/*'))\nfilenames.extend(tf.io.gfile.glob(str(GCS_PATH + '/chest_xray/val/*/*')))\n</code></pre>\n<p>see this link to understand the reason why \"TPUs read training data exclusively from GCS (Google Cloud Storage).\"<br>\n<a href=\"https://www.kaggle.com/docs/tpu#tpu3\" target=\"_blank\">https://www.kaggle.com/docs/tpu#tpu3</a></p>\n<p>Please keep sharing with me your questions and Tips &amp;Tricks you find.<br>\nso in the end, we can share our  Tips &amp;Tricks in public Kaggle notebook </p>\n<p>like this one <br>\n<a href=\"https://www.kaggle.com/faisalalsrheed/kaggle-to-colab-tips-tricks\" target=\"_blank\">https://www.kaggle.com/faisalalsrheed/kaggle-to-colab-tips-tricks</a></p>\n<p>Happy Learning 😀</p>",
          "rawMarkdown": "Hi @tt0721, \n\nIt is my pleasure 🙂\n\nI am learning too about using Google Colab for Kaggle. \nIt is an important skill to have when you do many competitions at the same time.\n\nYou can see here how I used it for past competitions ( it work with GPU and TPU)\nhttps://colab.research.google.com/drive/1tb73j5SB9oryTZsPGvH2I7rhPrvPUJcV?usp=sharing\n\nHere you can find another way to do it:\nhttps://www.kaggle.com/amyjang/tensorflow-pneumonia-classification-on-x-rays\n\nsee this part of the code :\n\n```\nfilenames = tf.io.gfile.glob(str(GCS_PATH + '/chest_xray/train/*/*'))\nfilenames.extend(tf.io.gfile.glob(str(GCS_PATH + '/chest_xray/val/*/*')))\n```\n\n\nsee this link to understand the reason why \"TPUs read training data exclusively from GCS (Google Cloud Storage).\"\nhttps://www.kaggle.com/docs/tpu#tpu3\n\nPlease keep sharing with me your questions and Tips &Tricks you find.\nso in the end, we can share our  Tips &Tricks in public Kaggle notebook \n\nlike this one \nhttps://www.kaggle.com/faisalalsrheed/kaggle-to-colab-tips-tricks\n\nHappy Learning 😀"
        },
        {
          "id": 1263334,
          "postDate": "2021-04-05T10:26:54.503Z",
          "content": "<p>Hi, <a href=\"https://www.kaggle.com/faisalalsrheed\" target=\"_blank\">@faisalalsrheed</a> </p>\n<p>Sorry for taking me so long to get back to you.<br>\nThank you for teaching me so kindly. <br>\nI'm learning a lot!<br>\nI'll check out the link you posted.</p>",
          "rawMarkdown": "Hi, @faisalalsrheed \n\nSorry for taking me so long to get back to you.\nThank you for teaching me so kindly. \nI'm learning a lot!\nI'll check out the link you posted."
        }
      ]
    },
    {
      "id": 1259653,
      "postDate": "2021-04-01T15:05:04.293Z",
      "content": "<p>Maybe you run into exceeding your storage quota, find the explanation here: <a href=\"https://research.google.com/colaboratory/faq.html\" target=\"_blank\">https://research.google.com/colaboratory/faq.html</a></p>",
      "rawMarkdown": "Maybe you run into exceeding your storage quota, find the explanation here: https://research.google.com/colaboratory/faq.html",
      "votes": 1,
      "replies": [
        {
          "id": 1260341,
          "postDate": "2021-04-02T03:22:26.487Z",
          "content": "<p>It's seems that it's not fault in strage quota.<br>\nIt sometimes happens samely when dataset is small:(<br>\nThank you for your answer!</p>",
          "rawMarkdown": "It's seems that it's not fault in strage quota.\nIt sometimes happens samely when dataset is small:(\nThank you for your answer!"
        }
      ]
    },
    {
      "id": 1259465,
      "postDate": "2021-04-01T12:32:56.967Z",
      "content": "<p>When I download dataset to google drive by API command and try to unzip those zip files, some of those data will be missing.<br>\nI'm using <code>unzip</code> command, on colab notebook.<br>\nI can confirm that unzipping is working on colab, but I can't see some of the data on drive.<br>\n(I'm colab pro user and subscribe 200GB strage.)</p>\n<p>Does anyone know how to solve it?<br>\nIs anyone else using colab without problems?</p>\n<hr>\n<p>P.S.<br>\nIt may just be a slow reflection on google drive.<br>\nI checked after a while and the data showed up fine.</p>",
      "rawMarkdown": "When I download dataset to google drive by API command and try to unzip those zip files, some of those data will be missing.\nI'm using <code>unzip</code> command, on colab notebook.\nI can confirm that unzipping is working on colab, but I can't see some of the data on drive.\n(I'm colab pro user and subscribe 200GB strage.)\n\nDoes anyone know how to solve it?\nIs anyone else using colab without problems?\n\n---\nP.S.\nIt may just be a slow reflection on google drive.\nI checked after a while and the data showed up fine.",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 1303220,
      "author_name": "Faisal Alsrheed",
      "author_url": "",
      "post_date": "2021-05-12T01:12:14.213000",
      "content": "<p><a href=\"https://www.kaggle.com/tt0721\" target=\"_blank\">@tt0721</a> </p>\n<p>Great job bronze :))))</p>\n<p>You must be very good in google colab now :)</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1304953,
          "author_name": "tsujino",
          "author_url": "",
          "post_date": "2021-05-13T03:00:46.270000",
          "content": "<p>Thanks! it's thanks to your advice:)<br>\nGreat job bronze, you too!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1260202,
      "author_name": "Faisal Alsrheed",
      "author_url": "",
      "post_date": "2021-04-01T23:32:55.637000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/tt0721\" target=\"_blank\">@tt0721</a> </p>\n<p>You don't need to download the dataset to your google drive.</p>\n<p>The dataset already in Google Cloud Storage, I used it for GPU and of course TPU </p>\n<p>see this comment from <a href=\"https://www.kaggle.com/mgornergoogle\" target=\"_blank\">@mgornergoogle</a></p>\n<p>\"To access the data, run KaggleDatasets().get_gcs_path() on Kaggle once. It will return a GCS bucket name like 'gs://xyz12234567890'. That's where Kaggle stores the attached dataset.\"</p>\n<p><a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130194\" target=\"_blank\">https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130194</a></p>\n<p>So You can find the path using this code:</p>\n<p>path_gcs = KaggleDatasets().get_gcs_path('hpa-single-cell-image-classification')<br>\nprint(path_gcs)</p>\n<p>See here :<br>\n<a href=\"https://www.kaggle.com/drcapa/human-protein-atlas-tpu-tutorial\" target=\"_blank\">https://www.kaggle.com/drcapa/human-protein-atlas-tpu-tutorial</a></p>\n<p>All the best </p>",
      "votes": 1,
      "replies": [
        {
          "id": 1260342,
          "author_name": "tsujino",
          "author_url": "",
          "post_date": "2021-04-02T03:23:25.643000",
          "content": "<p>Very helpful! I'll try it!<br>\nThank you very much!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1261402,
          "author_name": "tsujino",
          "author_url": "",
          "post_date": "2021-04-03T03:48:37.287000",
          "content": "<p>Hi, <a href=\"https://www.kaggle.com/faisalalsrheed\" target=\"_blank\">@faisalalsrheed</a><br>\nSorry for the newbie question, but please let me know if you can.</p>\n<p>When using GPU, is it possible to load data from GCS directly onto colab? <br>\nOr do I need to copy it to Drive once?</p>\n<p>I was able to get the bucket name, but I don't know what to do from there.<br>\nI've never used TPU before, so the explanation in the link you provided is not very clear for me:(<br>\nThanks!</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1261972,
          "author_name": "Faisal Alsrheed",
          "author_url": "",
          "post_date": "2021-04-03T16:29:56.770000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/tt0721\" target=\"_blank\">@tt0721</a>, </p>\n<p>It is my pleasure 🙂</p>\n<p>I am learning too about using Google Colab for Kaggle. <br>\nIt is an important skill to have when you do many competitions at the same time.</p>\n<p>You can see here how I used it for past competitions ( it work with GPU and TPU)<br>\n<a href=\"https://colab.research.google.com/drive/1tb73j5SB9oryTZsPGvH2I7rhPrvPUJcV?usp=sharing\" target=\"_blank\">https://colab.research.google.com/drive/1tb73j5SB9oryTZsPGvH2I7rhPrvPUJcV?usp=sharing</a></p>\n<p>Here you can find another way to do it:<br>\n<a href=\"https://www.kaggle.com/amyjang/tensorflow-pneumonia-classification-on-x-rays\" target=\"_blank\">https://www.kaggle.com/amyjang/tensorflow-pneumonia-classification-on-x-rays</a></p>\n<p>see this part of the code :</p>\n<pre><code>filenames = tf.io.gfile.glob(str(GCS_PATH + '/chest_xray/train/*/*'))\nfilenames.extend(tf.io.gfile.glob(str(GCS_PATH + '/chest_xray/val/*/*')))\n</code></pre>\n<p>see this link to understand the reason why \"TPUs read training data exclusively from GCS (Google Cloud Storage).\"<br>\n<a href=\"https://www.kaggle.com/docs/tpu#tpu3\" target=\"_blank\">https://www.kaggle.com/docs/tpu#tpu3</a></p>\n<p>Please keep sharing with me your questions and Tips &amp;Tricks you find.<br>\nso in the end, we can share our  Tips &amp;Tricks in public Kaggle notebook </p>\n<p>like this one <br>\n<a href=\"https://www.kaggle.com/faisalalsrheed/kaggle-to-colab-tips-tricks\" target=\"_blank\">https://www.kaggle.com/faisalalsrheed/kaggle-to-colab-tips-tricks</a></p>\n<p>Happy Learning 😀</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1263334,
          "author_name": "tsujino",
          "author_url": "",
          "post_date": "2021-04-05T10:26:54.503000",
          "content": "<p>Hi, <a href=\"https://www.kaggle.com/faisalalsrheed\" target=\"_blank\">@faisalalsrheed</a> </p>\n<p>Sorry for taking me so long to get back to you.<br>\nThank you for teaching me so kindly. <br>\nI'm learning a lot!<br>\nI'll check out the link you posted.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1259653,
      "author_name": "Alexander Riedel",
      "author_url": "",
      "post_date": "2021-04-01T15:05:04.293000",
      "content": "<p>Maybe you run into exceeding your storage quota, find the explanation here: <a href=\"https://research.google.com/colaboratory/faq.html\" target=\"_blank\">https://research.google.com/colaboratory/faq.html</a></p>",
      "votes": 1,
      "replies": [
        {
          "id": 1260341,
          "author_name": "tsujino",
          "author_url": "",
          "post_date": "2021-04-02T03:22:26.487000",
          "content": "<p>It's seems that it's not fault in strage quota.<br>\nIt sometimes happens samely when dataset is small:(<br>\nThank you for your answer!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1303220": "@tt0721 \n\nGreat job bronze :))))\n\nYou must be very good in google colab now :)",
    "1260202": "Hi @tt0721 \n\nYou don't need to download the dataset to your google drive.\n\nThe dataset already in Google Cloud Storage, I used it for GPU and of course TPU \n\nsee this comment from @mgornergoogle\n\n\"To access the data, run KaggleDatasets().get_gcs_path() on Kaggle once. It will return a GCS bucket name like 'gs://xyz12234567890'. That's where Kaggle stores the attached dataset.\"\n\nhttps://www.kaggle.com/c/flower-classification-with-tpus/discussion/130194\n\n\nSo You can find the path using this code:\n\npath_gcs = KaggleDatasets().get_gcs_path('hpa-single-cell-image-classification')\nprint(path_gcs)\n\nSee here :\nhttps://www.kaggle.com/drcapa/human-protein-atlas-tpu-tutorial\n\nAll the best ",
    "1259653": "Maybe you run into exceeding your storage quota, find the explanation here: https://research.google.com/colaboratory/faq.html",
    "1259465": "When I download dataset to google drive by API command and try to unzip those zip files, some of those data will be missing.\nI'm using <code>unzip</code> command, on colab notebook.\nI can confirm that unzipping is working on colab, but I can't see some of the data on drive.\n(I'm colab pro user and subscribe 200GB strage.)\n\nDoes anyone know how to solve it?\nIs anyone else using colab without problems?\n\n---\nP.S.\nIt may just be a slow reflection on google drive.\nI checked after a while and the data showed up fine."
  }
}