{
  "id": 317088,
  "title": "Colab -> TPU -> problem with private Dataset",
  "url": "/competitions/happy-whale-and-dolphin/discussion/317088",
  "author_name": "Remek Kinas",
  "post_date": "2022-04-05T12:13:30.511000",
  "votes": 13,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Hi, have you encountered problem with access to Kaggle Dataset from Colab (TPU)?<br>\nLast week something has changed and I can't read images from TFRecords. Till this day there was no problem to use Colab and priv Kaggle DS.</p>\n<p>Configuration:</p>\n<ul>\n<li>Colab Pro+ TPU</li>\n<li>Kaggle Dataset is private</li>\n<li>I can read TFRecords using gcp (bucket - gs://) - show length of TFRecord but can't access files inside</li>\n<li>I get and error</li>\n</ul>\n<pre><code>PermissionDeniedError: Error executing an HTTP request: HTTP response code 403 with body '{\n  \"error\": {\n    \"code\": 403,\n    \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n    \"errors\": [\n      {\n        \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n        \"domain\": \"global\",\n        \"reason\": \"forbidden\"\n      }\n    ]\n  }\n}\n</code></pre>",
  "messages": [
    {
      "id": 1745912,
      "postDate": "2022-04-05T12:13:30.510Z",
      "content": "<p>Hi, have you encountered problem with access to Kaggle Dataset from Colab (TPU)?<br>\nLast week something has changed and I can't read images from TFRecords. Till this day there was no problem to use Colab and priv Kaggle DS.</p>\n<p>Configuration:</p>\n<ul>\n<li>Colab Pro+ TPU</li>\n<li>Kaggle Dataset is private</li>\n<li>I can read TFRecords using gcp (bucket - gs://) - show length of TFRecord but can't access files inside</li>\n<li>I get and error</li>\n</ul>\n<pre><code>PermissionDeniedError: Error executing an HTTP request: HTTP response code 403 with body '{\n  \"error\": {\n    \"code\": 403,\n    \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n    \"errors\": [\n      {\n        \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n        \"domain\": \"global\",\n        \"reason\": \"forbidden\"\n      }\n    ]\n  }\n}\n</code></pre>",
      "rawMarkdown": "Hi, have you encountered problem with access to Kaggle Dataset from Colab (TPU)?\nLast week something has changed and I can't read images from TFRecords. Till this day there was no problem to use Colab and priv Kaggle DS.\n\nConfiguration:\n- Colab Pro+ TPU\n- Kaggle Dataset is private\n- I can read TFRecords using gcp (bucket - gs://) - show length of TFRecord but can't access files inside\n- I get and error\n\n```\nPermissionDeniedError: Error executing an HTTP request: HTTP response code 403 with body '{\n  \"error\": {\n    \"code\": 403,\n    \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n    \"errors\": [\n      {\n        \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n        \"domain\": \"global\",\n        \"reason\": \"forbidden\"\n      }\n    ]\n  }\n}\n```",
      "votes": 13
    },
    {
      "id": 1745966,
      "postDate": "2022-04-05T12:45:20.837Z",
      "content": "<p>Hi, Remek. The problem you are having is probably the same problem I have raised in this <a href=\"https://www.kaggle.com/competitions/happy-whale-and-dolphin/discussion/316140\" target=\"_blank\">discussion</a>. I am not very familiar with GCS, but I think the error is probably due to a change in google colab authentication method, as mentioned in this <a href=\"url\" target=\"_blank\">link</a>(<a href=\"https://github.com/googlecolab/colabtools/issues/2710#issuecomment-1086328194)\" target=\"_blank\">https://github.com/googlecolab/colabtools/issues/2710#issuecomment-1086328194)</a>. I haven't found a fundamental solution, but if you put the data directly into GCS Instead of getting the GCS path from the kaggle dataset, you should be able to load the images. </p>",
      "rawMarkdown": "Hi, Remek. The problem you are having is probably the same problem I have raised in this [discussion](https://www.kaggle.com/competitions/happy-whale-and-dolphin/discussion/316140). I am not very familiar with GCS, but I think the error is probably due to a change in google colab authentication method, as mentioned in this [link](url)(https://github.com/googlecolab/colabtools/issues/2710#issuecomment-1086328194). I haven't found a fundamental solution, but if you put the data directly into GCS Instead of getting the GCS path from the kaggle dataset, you should be able to load the images. ",
      "votes": 3,
      "replies": [
        {
          "id": 1745968,
          "postDate": "2022-04-05T12:47:16.730Z",
          "content": "<p>Thank you!!! 💪💪🤛👍👍</p>",
          "rawMarkdown": "Thank you!!! 💪💪🤛👍👍",
          "votes": 1
        }
      ]
    },
    {
      "id": 1746303,
      "postDate": "2022-04-05T16:40:32.210Z",
      "content": "<p>I just encountered this error in the afternoon. The first time was caused by my GCS writing wrong or expired. The second time I encountered it, it disappeared after I refreshed the page, but I don't know what caused it. of😂</p>",
      "rawMarkdown": "I just encountered this error in the afternoon. The first time was caused by my GCS writing wrong or expired. The second time I encountered it, it disappeared after I refreshed the page, but I don't know what caused it. of😂",
      "votes": 1
    },
    {
      "id": 1746019,
      "postDate": "2022-04-05T13:11:17.603Z",
      "content": "<p>I'd rather use google cloud storage. but it should be careful about billing  <br>\nthe private dataset in kaggle can be connected from google colab? i know that it can't</p>",
      "rawMarkdown": "I'd rather use google cloud storage. but it should be careful about billing  \nthe private dataset in kaggle can be connected from google colab? i know that it can't",
      "votes": 1,
      "replies": [
        {
          "id": 1746374,
          "postDate": "2022-04-05T17:46:29Z",
          "content": "<p>Yes. We used Kaggle private dataset as a gcp bucket all the time. Something had changed last week and now public one is accessible only :)</p>",
          "rawMarkdown": "Yes. We used Kaggle private dataset as a gcp bucket all the time. Something had changed last week and now public one is accessible only :)",
          "votes": 1
        }
      ]
    },
    {
      "id": 1752172,
      "postDate": "2022-04-11T13:43:51.107Z",
      "content": "<p>I got the same error and access behavior with normal Colab and my own GCS bucket. I solved it by changing the bucket access permissions: Added a \"principal\" with that email \"service-495559152420@cloud-tpu.iam.gserviceaccount.com\" and assigned the role \"Storage Object Viewer\".</p>\n<p>Now, that obviously won't work with a private kaggle dataset. Anyone found a solution here?</p>",
      "rawMarkdown": "I got the same error and access behavior with normal Colab and my own GCS bucket. I solved it by changing the bucket access permissions: Added a \"principal\" with that email \"service-495559152420@cloud-tpu.iam.gserviceaccount.com\" and assigned the role \"Storage Object Viewer\".\n\nNow, that obviously won't work with a private kaggle dataset. Anyone found a solution here?"
    },
    {
      "id": 1746055,
      "postDate": "2022-04-05T13:30:17.220Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1745966,
      "author_name": "kurokami",
      "author_url": "",
      "post_date": "2022-04-05T12:45:20.837000",
      "content": "<p>Hi, Remek. The problem you are having is probably the same problem I have raised in this <a href=\"https://www.kaggle.com/competitions/happy-whale-and-dolphin/discussion/316140\" target=\"_blank\">discussion</a>. I am not very familiar with GCS, but I think the error is probably due to a change in google colab authentication method, as mentioned in this <a href=\"url\" target=\"_blank\">link</a>(<a href=\"https://github.com/googlecolab/colabtools/issues/2710#issuecomment-1086328194)\" target=\"_blank\">https://github.com/googlecolab/colabtools/issues/2710#issuecomment-1086328194)</a>. I haven't found a fundamental solution, but if you put the data directly into GCS Instead of getting the GCS path from the kaggle dataset, you should be able to load the images. </p>",
      "votes": 3,
      "replies": [
        {
          "id": 1745968,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-04-05T12:47:16.730000",
          "content": "<p>Thank you!!! 💪💪🤛👍👍</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1746303,
      "author_name": "lyu",
      "author_url": "",
      "post_date": "2022-04-05T16:40:32.210000",
      "content": "<p>I just encountered this error in the afternoon. The first time was caused by my GCS writing wrong or expired. The second time I encountered it, it disappeared after I refreshed the page, but I don't know what caused it. of😂</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1746019,
      "author_name": "kaggler",
      "author_url": "",
      "post_date": "2022-04-05T13:11:17.603000",
      "content": "<p>I'd rather use google cloud storage. but it should be careful about billing  <br>\nthe private dataset in kaggle can be connected from google colab? i know that it can't</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1746374,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-04-05T17:46:29",
          "content": "<p>Yes. We used Kaggle private dataset as a gcp bucket all the time. Something had changed last week and now public one is accessible only :)</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1752172,
      "author_name": "Marius Wanko",
      "author_url": "",
      "post_date": "2022-04-11T13:43:51.107000",
      "content": "<p>I got the same error and access behavior with normal Colab and my own GCS bucket. I solved it by changing the bucket access permissions: Added a \"principal\" with that email \"service-495559152420@cloud-tpu.iam.gserviceaccount.com\" and assigned the role \"Storage Object Viewer\".</p>\n<p>Now, that obviously won't work with a private kaggle dataset. Anyone found a solution here?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1746055,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-04-05T13:30:17.220000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1745912": "Hi, have you encountered problem with access to Kaggle Dataset from Colab (TPU)?\nLast week something has changed and I can't read images from TFRecords. Till this day there was no problem to use Colab and priv Kaggle DS.\n\nConfiguration:\n- Colab Pro+ TPU\n- Kaggle Dataset is private\n- I can read TFRecords using gcp (bucket - gs://) - show length of TFRecord but can't access files inside\n- I get and error\n\n```\nPermissionDeniedError: Error executing an HTTP request: HTTP response code 403 with body '{\n  \"error\": {\n    \"code\": 403,\n    \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n    \"errors\": [\n      {\n        \"message\": \"service-495559152420@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object.\",\n        \"domain\": \"global\",\n        \"reason\": \"forbidden\"\n      }\n    ]\n  }\n}\n```",
    "1745966": "Hi, Remek. The problem you are having is probably the same problem I have raised in this [discussion](https://www.kaggle.com/competitions/happy-whale-and-dolphin/discussion/316140). I am not very familiar with GCS, but I think the error is probably due to a change in google colab authentication method, as mentioned in this [link](url)(https://github.com/googlecolab/colabtools/issues/2710#issuecomment-1086328194). I haven't found a fundamental solution, but if you put the data directly into GCS Instead of getting the GCS path from the kaggle dataset, you should be able to load the images. ",
    "1746303": "I just encountered this error in the afternoon. The first time was caused by my GCS writing wrong or expired. The second time I encountered it, it disappeared after I refreshed the page, but I don't know what caused it. of😂",
    "1746019": "I'd rather use google cloud storage. but it should be careful about billing  \nthe private dataset in kaggle can be connected from google colab? i know that it can't",
    "1752172": "I got the same error and access behavior with normal Colab and my own GCS bucket. I solved it by changing the bucket access permissions: Added a \"principal\" with that email \"service-495559152420@cloud-tpu.iam.gserviceaccount.com\" and assigned the role \"Storage Object Viewer\".\n\nNow, that obviously won't work with a private kaggle dataset. Anyone found a solution here?",
    "1746055": ""
  }
}