GoogleCloudPlatform / practical-ml-vision-book

Apache License 2.0
485 stars 228 forks source link

Chapter Two Permissions error #2

Closed craine closed 3 years ago

craine commented 3 years ago

In Chapter Two I'm trying to run this: CLASS_NAMES = [item.numpy().decode("utf-8") for item in tf.strings.regex_replace( tf.io.gfile.glob("gs://cloud-ml-data/img/flower_photos/*"), "gs://cloud-ml-data/img/flower_photos/", "")] CLASS_NAMES = [item for item in CLASS_NAMES if item.find(".") == -1]

Looks like I don't have permission to grab these?


PermissionDeniedError Traceback (most recent call last)

in () 1 CLASS_NAMES = [item.numpy().decode("utf-8") for item in 2 tf.strings.regex_replace( ----> 3 tf.io.gfile.glob("gs://cloud-ml-data/img/flower_photos/*"), 4 "gs://cloud-ml-data/img/flower_photos/", "")] 5 CLASS_NAMES = [item for item in CLASS_NAMES if item.find(".") == -1] /usr/local/lib/python3.7/dist-packages/tensorflow/python/lib/io/file_io.py in get_matching_files_v2(pattern) 441 compat.as_str_any(matching_filename) 442 for matching_filename in _pywrap_file_io.GetMatchingFiles( --> 443 compat.as_bytes(pattern)) 444 ] 445 else: PermissionDeniedError: Error executing an HTTP request: HTTP response code 401 with body '{ "error": { "code": 401, "message": "Anonymous caller does not have storage.objects.list access to the Google Cloud Storage bucket.", "errors": [ { "message": "Anonymous caller does not have storage.objects.list access to the Google Cloud Storage bucket.", "domain": "global", "reason": "required", "locationType": "header", "location": "Authorization" } ] } } ' when reading gs://cloud-ml-data/img/flower_photos
lakshmanok commented 3 years ago

Thanks. I'll file a request to get ListPermissions added to the bucket.

Meanwhile, you can workaround this by hardcoding the class names:

CLASS_NAMES = ['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips']
lakshmanok commented 3 years ago

I changed the bucket used. If you update your github repo, the notebook should work now.

VaneeshK commented 1 year ago

Still, this issue is occurring. I am not able to work with the notebook. PermissionDeniedError: Error executing an HTTP request: HTTP response code 403 with body '<?xml version='1.0' encoding='UTF-8'?><Error><Code>AccessDenied</Code><Message>Access denied.</Message><Details>There is an account problem for the requested project.</Details></Error>' when reading gs://practical-ml-vision-book/flowers_5_jpeg/flower_photos/daisy/754296579_30a9ae018c_n.jpg [Op:ReadFile]

lakshmanok commented 1 year ago

Yes, public access to the bucket seems to have been turned off. We are looking into it

thanks, Lak

On Thu, Jun 1, 2023, 12:38 PM VaneeshK @.***> wrote:

Still, this issue is occurring. I am not able to work with the notebook. PermissionDeniedError: Error executing an HTTP request: HTTP response code 403 with body '<?xml version='1.0' encoding='UTF-8'?>AccessDeniedAccess denied.

There is an account problem for the requested project.
' when reading gs://practical-ml-vision-book/flowers_5_jpeg/flower_photos/daisy/754296579_30a9ae018c_n.jpg [Op:ReadFile]

— Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/practical-ml-vision-book/issues/2#issuecomment-1571886943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANJPZZCWGQ75H3CILKMG5LXJB5MRANCNFSM5BJ6RBMA . You are receiving this because you modified the open/close state.Message ID: <GoogleCloudPlatform/practical-ml-vision-book/issues/2/1571886943@ github.com>