{
  "id": 147081,
  "title": "Get GCS path for TPU",
  "url": "/competitions/herbarium-2020-fgvc7/discussion/147081",
  "author_name": "",
  "post_date": "2020-04-29T12:29:13.508065500Z",
  "votes": 1,
  "comment_count": 5,
  "views": 0,
  "content": "<p>I get the following error when I call function <code>get_gcs_path()</code></p>\n\n<h2>```</h2>\n\n<p>HTTPError                                 Traceback (most recent call last)\n~/.local/lib/python3.6/site-packages/kaggle_web_client.py in make_post_request(self, data, endpoint)\n     37         try:\n---&gt; 38             with urllib.request.urlopen(req, timeout=self.TIMEOUT_SECS) as response:\n     39                 response_json = json.loads(response.read())</p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)\n    222         opener = _opener\n--&gt; 223     return opener.open(url, data, timeout)\n    224 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)\n    531             meth = getattr(processor, meth_name)\n--&gt; 532             response = meth(req, response)\n    533 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in http_response(self, request, response)\n    641             response = self.parent.error(\n--&gt; 642                 'http', request, response, code, msg, hdrs)\n    643 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in error(self, proto, *args)\n    569             args = (dict, 'default', 'http_error_default') + orig_args\n--&gt; 570             return self._call_chain(*args)\n    571 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)\n    503             func = getattr(handler, meth_name)\n--&gt; 504             result = func(*args)\n    505             if result is not None:</p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)\n    649     def http_error_default(self, req, fp, code, msg, hdrs):\n--&gt; 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)\n    651 </p>\n\n<p>HTTPError: HTTP Error 400: Bad Request</p>\n\n<p>The above exception was the direct cause of the following exception:</p>\n\n<p>ConnectionError                           Traceback (most recent call last)\n in \n      1 from kaggle_datasets import KaggleDatasets\n      2 \n----&gt; 3 GCS_PATH = KaggleDatasets().get_gcs_path()\n      4 GCS_PATH</p>\n\n<p>~/.local/lib/python3.6/site-packages/kaggle_datasets.py in get_gcs_path(self, dataset_dir)\n     21             'IntegrationType': integration_type,\n     22         }\n---&gt; 23         result = self.web_client.make_post_request(data, self.GET_GCS_PATH_ENDPOINT)\n     24         return result['destinationBucket']</p>\n\n<p>~/.local/lib/python3.6/site-packages/kaggle_web_client.py in make_post_request(self, data, endpoint)\n     49                     'Timeout error trying to communicate with service. Please ensure internet is on.') from e\n     50             raise ConnectionError(\n---&gt; 51                 'Connection error trying to communicate with service.') from e\n     52         except HTTPError as e:\n     53             if e.code == 401 or e.code == 403:</p>\n\n<p>ConnectionError: Connection error trying to communicate with service.</p>\n\n<p>```</p>\n\n<p>Is there some ways to load images for TPU?</p>",
  "messages": [
    {
      "id": "826063",
      "postDate": "04/29/2020 12:29:13",
      "content": "<p>I get the following error when I call function <code>get_gcs_path()</code></p>\n\n<h2>```</h2>\n\n<p>HTTPError                                 Traceback (most recent call last)\n~/.local/lib/python3.6/site-packages/kaggle_web_client.py in make_post_request(self, data, endpoint)\n     37         try:\n---&gt; 38             with urllib.request.urlopen(req, timeout=self.TIMEOUT_SECS) as response:\n     39                 response_json = json.loads(response.read())</p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)\n    222         opener = _opener\n--&gt; 223     return opener.open(url, data, timeout)\n    224 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)\n    531             meth = getattr(processor, meth_name)\n--&gt; 532             response = meth(req, response)\n    533 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in http_response(self, request, response)\n    641             response = self.parent.error(\n--&gt; 642                 'http', request, response, code, msg, hdrs)\n    643 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in error(self, proto, *args)\n    569             args = (dict, 'default', 'http_error_default') + orig_args\n--&gt; 570             return self._call_chain(*args)\n    571 </p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)\n    503             func = getattr(handler, meth_name)\n--&gt; 504             result = func(*args)\n    505             if result is not None:</p>\n\n<p>/opt/conda/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)\n    649     def http_error_default(self, req, fp, code, msg, hdrs):\n--&gt; 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)\n    651 </p>\n\n<p>HTTPError: HTTP Error 400: Bad Request</p>\n\n<p>The above exception was the direct cause of the following exception:</p>\n\n<p>ConnectionError                           Traceback (most recent call last)\n in \n      1 from kaggle_datasets import KaggleDatasets\n      2 \n----&gt; 3 GCS_PATH = KaggleDatasets().get_gcs_path()\n      4 GCS_PATH</p>\n\n<p>~/.local/lib/python3.6/site-packages/kaggle_datasets.py in get_gcs_path(self, dataset_dir)\n     21             'IntegrationType': integration_type,\n     22         }\n---&gt; 23         result = self.web_client.make_post_request(data, self.GET_GCS_PATH_ENDPOINT)\n     24         return result['destinationBucket']</p>\n\n<p>~/.local/lib/python3.6/site-packages/kaggle_web_client.py in make_post_request(self, data, endpoint)\n     49                     'Timeout error trying to communicate with service. Please ensure internet is on.') from e\n     50             raise ConnectionError(\n---&gt; 51                 'Connection error trying to communicate with service.') from e\n     52         except HTTPError as e:\n     53             if e.code == 401 or e.code == 403:</p>\n\n<p>ConnectionError: Connection error trying to communicate with service.</p>\n\n<p>```</p>\n\n<p>Is there some ways to load images for TPU?</p>",
      "rawMarkdown": "I get the following error when I call function `get_gcs_path()`\n\n```\n---------------------------------------------------------------------------\nHTTPError                                 Traceback (most recent call last)\n~/.local/lib/python3.6/site-packages/kaggle_web_client.py in make_post_request(self, data, endpoint)\n     37         try:\n---&gt; 38             with urllib.request.urlopen(req, timeout=self.TIMEOUT_SECS) as response:\n     39                 response_json = json.loads(response.read())\n\n/opt/conda/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)\n    222         opener = _opener\n--&gt; 223     return opener.open(url, data, timeout)\n    224 \n\n/opt/conda/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)\n    531             meth = getattr(processor, meth_name)\n--&gt; 532             response = meth(req, response)\n    533 \n\n/opt/conda/lib/python3.6/urllib/request.py in http_response(self, request, response)\n    641             response = self.parent.error(\n--&gt; 642                 'http', request, response, code, msg, hdrs)\n    643 \n\n/opt/conda/lib/python3.6/urllib/request.py in error(self, proto, *args)\n    569             args = (dict, 'default', 'http_error_default') + orig_args\n--&gt; 570             return self._call_chain(*args)\n    571 \n\n/opt/conda/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)\n    503             func = getattr(handler, meth_name)\n--&gt; 504             result = func(*args)\n    505             if result is not None:\n\n/opt/conda/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)\n    649     def http_error_default(self, req, fp, code, msg, hdrs):\n--&gt; 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)\n    651 \n\nHTTPError: HTTP Error 400: Bad Request\n\nThe above exception was the direct cause of the following exception:\n\nConnectionError                           Traceback (most recent call last)",
      "votes": null
    },
    {
      "id": "826322",
      "postDate": "04/29/2020 15:20:39",
      "content": "<p>Does this discussion help?</p>\n\n<p><a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130326\">https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130326</a></p>",
      "rawMarkdown": "Does this discussion help?\n\nhttps://www.kaggle.com/c/flower-classification-with-tpus/discussion/130326",
      "votes": null
    },
    {
      "id": "826870",
      "postDate": "04/29/2020 23:01:40",
      "content": "<p>no, I get the error message above, herbarium-2020-fgvc7 is public data too.</p>",
      "rawMarkdown": "no, I get the error message above, herbarium-2020-fgvc7 is public data too.",
      "votes": null
    },
    {
      "id": "834909",
      "postDate": "05/05/2020 22:06:47",
      "content": "<p>I got almost the same problem but with the same code. When I try <code>GCS_DS_PATH = KaggleDatasets().get_gcs_path()</code>\nI get the error <code>ConnectionError: Connection error trying to communicate with service.</code>\nI have turned on the internet but still no result. \nI have also tried <code>GCS_DS_PATH = KaggleDatasets().get_gcs_path('herbarium-2020-fgvc7')</code> but same error message.\nHave you found a solution maybe, it will solve my problem aswell? B.t.w have you tried turning on the internet, sometimes it works .</p>",
      "rawMarkdown": "I got almost the same problem but with the same code. When I try `GCS_DS_PATH = KaggleDatasets().get_gcs_path()`\nI get the error `ConnectionError: Connection error trying to communicate with service.`\nI have turned on the internet but still no result. \nI have also tried `GCS_DS_PATH = KaggleDatasets().get_gcs_path('herbarium-2020-fgvc7')` but same error message.\nHave you found a solution maybe, it will solve my problem aswell? B.t.w have you tried turning on the internet, sometimes it works .",
      "votes": null
    },
    {
      "id": "852523",
      "postDate": "05/18/2020 14:05:46",
      "content": "<p>Have you found the solution?</p>",
      "rawMarkdown": "Have you found the solution?",
      "votes": null
    },
    {
      "id": "873212",
      "postDate": "06/03/2020 22:59:16",
      "content": "<p>I 2nd this.  I experience the same issue all the time.  It's totally random.  Sometimes the code works without issue, and then all of a sudden the same code stops working for no apparent reason.  It's super annoying.  I'll be getting all this work done and then all of a sudden I can't get anything done anymore and my notebooks are broken.</p>\n\n<p><code>GCS_DS_PATH = KaggleDatasets().get_gcs_path()</code></p>\n\n<p><code>GCS_DS_PATH = KaggleDatasets().get_gcs_path('data-set-folder')</code></p>\n\n<p>☹️ </p>",
      "rawMarkdown": "I 2nd this.  I experience the same issue all the time.  It's totally random.  Sometimes the code works without issue, and then all of a sudden the same code stops working for no apparent reason.  It's super annoying.  I'll be getting all this work done and then all of a sudden I can't get anything done anymore and my notebooks are broken.\n\n`GCS_DS_PATH = KaggleDatasets().get_gcs_path()`\n\n`GCS_DS_PATH = KaggleDatasets().get_gcs_path('data-set-folder')`\n\n☹️",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 826322,
      "author_name": "inversion",
      "author_url": "",
      "post_date": "04/29/2020 15:20:39",
      "content": "<p>Does this discussion help?</p>\n\n<p><a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130326\">https://www.kaggle.com/c/flower-classification-with-tpus/discussion/130326</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 826870,
          "author_name": "albedo",
          "author_url": "",
          "post_date": "04/29/2020 23:01:40",
          "content": "<p>no, I get the error message above, herbarium-2020-fgvc7 is public data too.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 852523,
          "author_name": "marcelosanchezortega",
          "author_url": "",
          "post_date": "05/18/2020 14:05:46",
          "content": "<p>Have you found the solution?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 834909,
      "author_name": "nickteim",
      "author_url": "",
      "post_date": "05/05/2020 22:06:47",
      "content": "<p>I got almost the same problem but with the same code. When I try <code>GCS_DS_PATH = KaggleDatasets().get_gcs_path()</code>\nI get the error <code>ConnectionError: Connection error trying to communicate with service.</code>\nI have turned on the internet but still no result. \nI have also tried <code>GCS_DS_PATH = KaggleDatasets().get_gcs_path('herbarium-2020-fgvc7')</code> but same error message.\nHave you found a solution maybe, it will solve my problem aswell? B.t.w have you tried turning on the internet, sometimes it works .</p>",
      "votes": null,
      "replies": [
        {
          "id": 873212,
          "author_name": "yeayates21",
          "author_url": "",
          "post_date": "06/03/2020 22:59:16",
          "content": "<p>I 2nd this.  I experience the same issue all the time.  It's totally random.  Sometimes the code works without issue, and then all of a sudden the same code stops working for no apparent reason.  It's super annoying.  I'll be getting all this work done and then all of a sudden I can't get anything done anymore and my notebooks are broken.</p>\n\n<p><code>GCS_DS_PATH = KaggleDatasets().get_gcs_path()</code></p>\n\n<p><code>GCS_DS_PATH = KaggleDatasets().get_gcs_path('data-set-folder')</code></p>\n\n<p>☹️ </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "826063": "I get the following error when I call function `get_gcs_path()`\n\n```\n---------------------------------------------------------------------------\nHTTPError                                 Traceback (most recent call last)\n~/.local/lib/python3.6/site-packages/kaggle_web_client.py in make_post_request(self, data, endpoint)\n     37         try:\n---&gt; 38             with urllib.request.urlopen(req, timeout=self.TIMEOUT_SECS) as response:\n     39                 response_json = json.loads(response.read())\n\n/opt/conda/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)\n    222         opener = _opener\n--&gt; 223     return opener.open(url, data, timeout)\n    224 \n\n/opt/conda/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)\n    531             meth = getattr(processor, meth_name)\n--&gt; 532             response = meth(req, response)\n    533 \n\n/opt/conda/lib/python3.6/urllib/request.py in http_response(self, request, response)\n    641             response = self.parent.error(\n--&gt; 642                 'http', request, response, code, msg, hdrs)\n    643 \n\n/opt/conda/lib/python3.6/urllib/request.py in error(self, proto, *args)\n    569             args = (dict, 'default', 'http_error_default') + orig_args\n--&gt; 570             return self._call_chain(*args)\n    571 \n\n/opt/conda/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)\n    503             func = getattr(handler, meth_name)\n--&gt; 504             result = func(*args)\n    505             if result is not None:\n\n/opt/conda/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)\n    649     def http_error_default(self, req, fp, code, msg, hdrs):\n--&gt; 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)\n    651 \n\nHTTPError: HTTP Error 400: Bad Request\n\nThe above exception was the direct cause of the following exception:\n\nConnectionError                           Traceback (most recent call last)",
    "826322": "Does this discussion help?\n\nhttps://www.kaggle.com/c/flower-classification-with-tpus/discussion/130326",
    "826870": "no, I get the error message above, herbarium-2020-fgvc7 is public data too.",
    "834909": "I got almost the same problem but with the same code. When I try `GCS_DS_PATH = KaggleDatasets().get_gcs_path()`\nI get the error `ConnectionError: Connection error trying to communicate with service.`\nI have turned on the internet but still no result. \nI have also tried `GCS_DS_PATH = KaggleDatasets().get_gcs_path('herbarium-2020-fgvc7')` but same error message.\nHave you found a solution maybe, it will solve my problem aswell? B.t.w have you tried turning on the internet, sometimes it works .",
    "852523": "Have you found the solution?",
    "873212": "I 2nd this.  I experience the same issue all the time.  It's totally random.  Sometimes the code works without issue, and then all of a sudden the same code stops working for no apparent reason.  It's super annoying.  I'll be getting all this work done and then all of a sudden I can't get anything done anymore and my notebooks are broken.\n\n`GCS_DS_PATH = KaggleDatasets().get_gcs_path()`\n\n`GCS_DS_PATH = KaggleDatasets().get_gcs_path('data-set-folder')`\n\n☹️"
  },
  "source": "meta"
}