Skip to content

Failed access to S3 : object does not exist even if object is existing #2145

Description

@gg4u

I installed tensorflow io like this to ensure compatibilty :

!pip install tensorflow-io[tensorflow]

That partially solved an issue of compatibilty, but still cannot access the WAV files in the S3 bucket:

Test:


s3_file_path = 's3://fruitbat-vocalizations/data/annotated_segments/files101/120601002132055008.WAV/'

# Read the audio file from S3
audio_tensor = tfio.audio.AudioIOTensor(s3_file_path)

# Access the audio data and sample rate
audio_data = audio_tensor.to_tensor()
sample_rate = audio_tensor.rate

Error:


2025-04-04 19:45:14.973303: W tensorflow/core/framework/op_kernel.cc:1839] OP_REQUIRES failed at audio_kernels.cc:130 : NOT_FOUND: Object s3://fruitbat-vocalizations/data/annotated_segments/files101/120601002132055008.WAV/ does not exist
2025-04-04 19:45:14.973377: W tensorflow/core/framework/local_rendezvous.cc:404] Local rendezvous is aborting with status: NOT_FOUND: Object s3://fruitbat-vocalizations/data/annotated_segments/files101/120601002132055008.WAV/ does not exist

---------------------------------------------------------------------------
NotFoundError                             Traceback (most recent call last)
Cell In[12], line 4
      1 s3_file_path = 's3://fruitbat-vocalizations/data/annotated_segments/files101/120601002132055008.WAV/'
      3 # Read the audio file from S3
----> 4 audio_tensor = tfio.audio.AudioIOTensor(s3_file_path)
      6 # Access the audio data and sample rate
      7 audio_data = audio_tensor.to_tensor()

File ~/.conda/envs/fruitbat/lib/python3.10/site-packages/tensorflow_io/python/ops/audio_ops.py:671, in AudioIOTensor.__init__(self, filename, dtype)
    669 if not tf.executing_eagerly():
    670     assert dtype is not None, "dtype must be provided in graph mode"
--> 671 resource = core_ops.io_audio_readable_init(filename)
    672 if tf.executing_eagerly():
    673     shape, dtype, rate = core_ops.io_audio_readable_spec(resource)

File <string>:14008, in io_audio_readable_init(input, container, shared_name, name)

File <string>:14070, in io_audio_readable_init_eager_fallback(input, container, shared_name, name, ctx)

File ~/.conda/envs/fruitbat/lib/python3.10/site-packages/tensorflow/python/eager/execute.py:53, in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     51 try:
     52   ctx.ensure_initialized()
---> 53   tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
     54                                       inputs, attrs, num_outputs)
     55 except core._NotOkStatusException as e:
     56   if name is not None:

NotFoundError: {{function_node __wrapped__IO>AudioReadableInit_device_/job:localhost/replica:0/task:0/device:CPU:0}} Object s3://fruitbat-vocalizations/data/annotated_segments/files101/120601002132055008.WAV/ does not exist [Op:IO>AudioReadableInit]

The file is in the bucket and the s3 URI is correct, I copy-pasted from the AWS console.

I also tried with the scheme s3e:// but that did not worked either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions