Tensorflow - S3 object does not exist

King Dedede

How do I set up direct private bucket access for Tensorflow?

After running
from tensorflow.python.lib.io import file_io and running print file_io.stat('s3://my/private/bucket/file.json') I end up with an error -
NotFoundError: Object s3://my/private/bucket/file.json does not exist

However, the same line on a public object works without an error:
print file_io.stat('s3://ryft-public-sample-data/wikipedia-20150518.bin')

There appears to be an article on support here: https://github.com/tensorflow/examples/blob/master/community/en/docs/deploy/s3.md
However, I end up with the same error after exporting the variables shown.

I have awscli set up with all credentials, and boto3 can view and download the file in question. I am wondering how I can get Tensorflow to have S3 access directly when the bucket is private.

marcin

I had the same problem when trying to access files in private S3 bucket from Sagemaker notebook. The mistake I made was to try using credentials I obtained from boto3, which seem not to be valid outside.

The solution was not to specify credentials (in such case it uses the role attached to the machine), but instead just specify the region name (for some reason it didn't read it from ~/.aws/config file) as follows:

import boto3
import os

session = boto3.Session()
os.environ['AWS_REGION']=session.region_name

NOTE: when debugging this error useful was to look at CloudWatch logs, as the logs of S3 client were printed only there and not in the Jupyter notebook. In there I have first have seen, that:

  1. when I did specify credentials from boto3 the error was: The AWS Access Key Id you provided does not exist in our records.
  2. When accessing without AWS_REGION env variable set I had The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. which apparently is common when you don't specify bucket (see 301 Moved Permanently after S3 uploading)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

object outer does not exist

JSTL: Does Object Exist

Check if an object exist in S3 to then use it in Lambda CDK construct

AWS s3 api error: specified bucket does not exist

Snapshot does not exist error on restoring from s3 repository

how to fix property does not exist on type 'Object' in ionic 3?

Property 'map' does not exist on type 'Object' - Ionic 3

FIXED-IONIC 3: property 'questions' does not exist on type 'Object'

Property '' does not exist on type 'Object'

Property does not exist on type 'object'

Update an object or create it if does not exist

Firebase image object does not exist?

Property does not exist on type 'object'

AWS Tools: Copy-S3Object script fails in 2.x with Error "Bucket does not exist"

Write-S3Object : The file indicated by the FilePath property does not exist

AWS CLI S3 rm command does not produce error if file does not exist

Populating an array of object with 0 if object does not exist

Does AWS S3 GetObject read the partial of the Object being uploaded to s3 at the same time

S3 head object but signature does not match

Does AWS S3 object support POSIX Hardlinks?

How does an S3 object invoke a method?

"... matching query does not exist." error, but object clearly does exist

FailedPreconditionError: Resource localhost/_AnonymousVar404/N10tensorflow3VarE does not exist

Terraform init Error: Failed to get existing workspaces: S3 bucket does not exist

'specified bucket does not exist ' error - S3 bucket with Policy disallow upload from particular IP

CloudFront + S3 Website: "The specified key does not exist" when an implicit index document should be displayed

Glacier and S3 using lifecycle rules, specified key does not exist

SonataMediaBundle - S3 AWS: 'The configured bucket "my-bucket" does not exist

AWS S3 CopyObjectAsync fails with key does not exist, but get/put succeeds

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive