Accessing element of AudioIOTensor kills Jupyter Kernel

Viewed 56

I'm trying to access an element of a tf io AudioIOTensor. It looks reasonable to my untrained eye during loading.

audio_tensor = tfio.audio.AudioIOTensor("my_file.mp3")
<AudioIOTensor: shape=[8084480       2], dtype=<dtype: 'float32'>, rate=44100>

When printing element 1, it looks like this

audio_tensor[1]
<tf.Tensor: shape=(2,), dtype=float32, numpy=array([ 0.000000e+00, -3.859234e-16], dtype=float32)>

It has 2 values at index 1 and I tried getting the second one

audio_tensor[1, 1]

and every executed block thereafter, it outputs

Error: Kernel is dead Error: Kernel is dead at g._sendKernelShellControl (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:1006195) at g.sendShellMessage (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:1005964) at g.requestExecute (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:1008506) at d.requestExecute (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:37:325680) at w.requestExecute (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:32:18027) at w.executeCodeCell (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:301076) at w.execute (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:300703) at w.start (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:296367) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async t.CellExecutionQueue.executeQueuedCells (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:311160) at async t.CellExecutionQueue.start (c:\Users\jonam.vscode\extensions\ms-toolsai.jupyter-2021.8.2041215044\out\client\extension.js:52:310700)

Why does the kernel die instead of returning -3.859234e-16?

I'm using Python 3.9.6, tensorflow_io 0.21.0, jupyter notebook 6.2.0 (as best as I can tell) and it's all running in vs code, if that makes any difference.

Any help would be appreciated, have a nice day :)

0 Answers
Related