{
  "id": 137429,
  "title": "How to import kaggle_datasets on local  kernel?",
  "url": "/competitions/flower-classification-with-tpus/discussion/137429",
  "author_name": "",
  "post_date": "2020-03-20T17:36:22.956377Z",
  "votes": 7,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I'm working on this competition on my local machine but unable to run <code>from kaggle_datasets import KaggleDatasets</code> as I'm getting <code>ModuleNotFoundError: No module named 'kaggle.datasets'</code>.</p>\n\n<p>I tried <code>pip install kaggle</code> but that didn't help.</p>",
  "messages": [
    {
      "id": "780873",
      "postDate": "03/20/2020 17:36:22",
      "content": "<p>I'm working on this competition on my local machine but unable to run <code>from kaggle_datasets import KaggleDatasets</code> as I'm getting <code>ModuleNotFoundError: No module named 'kaggle.datasets'</code>.</p>\n\n<p>I tried <code>pip install kaggle</code> but that didn't help.</p>",
      "rawMarkdown": "I'm working on this competition on my local machine but unable to run `from kaggle_datasets import KaggleDatasets` as I'm getting `ModuleNotFoundError: No module named 'kaggle.datasets'`.\n\nI tried `pip install kaggle` but that didn't help.",
      "votes": null
    },
    {
      "id": "780880",
      "postDate": "03/20/2020 17:46:07",
      "content": "<p>If you are working on your local machine, download the dataset to your local machine. You will not be able to use a TPU though.</p>\n\n<p>If you want to work with a TPU-enabled Notebook VM in GCP (here is how to provision one: bit.ly/keras-tpu-tf21), then I recommend you download the dataset and upload it to a GCS bucket. TPUs can only read data from GCS.</p>\n\n<p>There is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().get_gcs_path() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though.</p>",
      "rawMarkdown": "If you are working on your local machine, download the dataset to your local machine. You will not be able to use a TPU though.\n\nIf you want to work with a TPU-enabled Notebook VM in GCP (here is how to provision one: [bit.ly/keras-tpu-tf21](bit.ly/keras-tpu-tf21)), then I recommend you download the dataset and upload it to a GCS bucket. TPUs can only read data from GCS.\n\nThere is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().get_gcs_path() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though.",
      "votes": null
    },
    {
      "id": "780887",
      "postDate": "03/20/2020 17:54:15",
      "content": "<p>Got it. Thanks a lot!</p>",
      "rawMarkdown": "Got it. Thanks a lot!",
      "votes": null
    },
    {
      "id": "804105",
      "postDate": "04/11/2020 08:27:52",
      "content": "<p>What if I want to use the dataset in Google Colab?</p>",
      "rawMarkdown": "What if I want to use the dataset in Google Colab?",
      "votes": null
    },
    {
      "id": "806332",
      "postDate": "04/13/2020 16:17:24",
      "content": "<p>the answer is above:</p>\n\n<blockquote>\n  <p>I recommend you download the dataset and upload it to a GCS bucket.</p>\n  \n  <p>There is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().getgcspath() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though.</p>\n</blockquote>",
      "rawMarkdown": "the answer is above:\n\n&gt; I recommend you download the dataset and upload it to a GCS bucket.\n\n&gt; There is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().getgcspath() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 780880,
      "author_name": "mgorner",
      "author_url": "",
      "post_date": "03/20/2020 17:46:07",
      "content": "<p>If you are working on your local machine, download the dataset to your local machine. You will not be able to use a TPU though.</p>\n\n<p>If you want to work with a TPU-enabled Notebook VM in GCP (here is how to provision one: bit.ly/keras-tpu-tf21), then I recommend you download the dataset and upload it to a GCS bucket. TPUs can only read data from GCS.</p>\n\n<p>There is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().get_gcs_path() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though.</p>",
      "votes": null,
      "replies": [
        {
          "id": 780887,
          "author_name": "alexandersoare",
          "author_url": "",
          "post_date": "03/20/2020 17:54:15",
          "content": "<p>Got it. Thanks a lot!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 804105,
      "author_name": "rhtsingh",
      "author_url": "",
      "post_date": "04/11/2020 08:27:52",
      "content": "<p>What if I want to use the dataset in Google Colab?</p>",
      "votes": null,
      "replies": [
        {
          "id": 806332,
          "author_name": "mgorner",
          "author_url": "",
          "post_date": "04/13/2020 16:17:24",
          "content": "<p>the answer is above:</p>\n\n<blockquote>\n  <p>I recommend you download the dataset and upload it to a GCS bucket.</p>\n  \n  <p>There is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().getgcspath() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though.</p>\n</blockquote>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "780873": "I'm working on this competition on my local machine but unable to run `from kaggle_datasets import KaggleDatasets` as I'm getting `ModuleNotFoundError: No module named 'kaggle.datasets'`.\n\nI tried `pip install kaggle` but that didn't help.",
    "780880": "If you are working on your local machine, download the dataset to your local machine. You will not be able to use a TPU though.\n\nIf you want to work with a TPU-enabled Notebook VM in GCP (here is how to provision one: [bit.ly/keras-tpu-tf21](bit.ly/keras-tpu-tf21)), then I recommend you download the dataset and upload it to a GCS bucket. TPUs can only read data from GCS.\n\nThere is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().get_gcs_path() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though.",
    "780887": "Got it. Thanks a lot!",
    "804105": "What if I want to use the dataset in Google Colab?",
    "806332": "the answer is above:\n\n&gt; I recommend you download the dataset and upload it to a GCS bucket.\n\n&gt; There is a way of working directly with the GCS bucket Kaggle uses for the dataset: call KaggleDataset().getgcspath() on Kaggle, record the GCS path it gives you. You can then use it from anywhere. Two caveats: the Kaggle API gets you a bucket in the same region as your Kaggle TPU which might not be the region you want. Also, The Kaggle API treats this GCS bucket as a cache. It can erase and recreate it under a different name at any time. It should stay good for a couple of days though."
  },
  "source": "meta"
}