tensorflow
tensorflow copied to clipboard
tf.audio.decode_wav: Aborted (core dumped)
trafficstars
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
binary
TensorFlow version
tf 2.15
Custom code
Yes
OS platform and distribution
Ubuntu 20.04
Mobile device
No response
Python version
3.9
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
Under specific input, tf.audio.decode_wav encounters "Aborted (core dumped)".
Standalone code to reproduce the issue
import tensorflow as tf
import numpy as np
import io
sample_rate = 44100
num_channels = 2
duration_seconds = 5
num_samples = sample_rate * duration_seconds
input_data = np.random.randint(-32768, 32767, size=(num_samples, num_channels)).astype(np.int16)
wav_io = io.BytesIO()
wav_write = tf.audio.encode_wav(input_data, sample_rate)
wav_io.write(wav_write.numpy())
wav_contents = wav_io.getvalue()
desired_channels = -num_channels - 1
decoded_audio = tf.audio.decode_wav(wav_contents, desired_channels=desired_channels)
Relevant log output
2024-03-14 05:35:10.682129: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected a non-negative size, got -3
Aborted (core dumped)
@nonenone12135, As mentioned above, the tf.audio.decode_wav is not working for the specific input(most cases when desired_channels is -ve value), with the +ve input it is working without any issue. Kindly find the gist of it here. Please allow some time to deep dive into the issue and provide the resolution. Thank you!