You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a piece of code that extracts embeddings. This works perfectly fine tensorflow==2.16.1, but starts to break on tensorflow==2.17.0. I'm not sure why it starts to throw this error. The tensorflow changelog doesn't show anything egregious: https://github.com/tensorflow/tensorflow/releases/tag/v2.17.0
tests/inference/test_birdnet.py:6:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
inference/birdnet.py:87: in predict
embeddings.append(self._infer(row))
inference/birdnet.py:70: in _infer
recording.extract_embeddings()
/path/to/.venv/lib/python3.10/site-packages/birdnetlib/main.py:80: in extract_embeddings
self.analyzer.extract_embeddings_for_recording(self)
/path/to/.venv/lib/python3.10/site-packages/birdnetlib/analyzer.py:381: in extract_embeddings_for_recording
e = self._return_embeddings(data)[0].tolist()
/path/to/.venv/lib/python3.10/site-packages/birdnetlib/analyzer.py:454: in _return_embeddings
features = self.interpreter.get_tensor(output_layer_index)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow.lite.python.interpreter.Interpreter object at 0xXXXXXXXXXXXX>, tensor_index = 545, subgraph_index = 0
def get_tensor(self, tensor_index, subgraph_index=0):
"""Gets the value of the output tensor (get a copy).
If you wish to avoid the copy, use `tensor()`. This function cannot be used
to read intermediate results.
Args:
tensor_index: Tensor index of tensor to get. This value can be gotten from
the 'index' field in get_output_details.
subgraph_index: Index of the subgraph to fetch the tensor. Default value
is 0, which means to fetch from the primary subgraph.
Returns:
a numpy array.
"""
> return self._interpreter.GetTensor(tensor_index, subgraph_index)
E ValueError: Tensor data is null. Run allocate_tensors() first
/path/to/.venv/lib/python3.10/site-packages/tensorflow/lite/python/interpreter.py:888: ValueError
The workaround is to pin tensorflow to the last known working version.
The text was updated successfully, but these errors were encountered:
acmiyaguchi
changed the title
Tensorflow 2.17.0 break embedding workflow
Tensorflow 2.17.0 breaks embedding workflow
Feb 21, 2025
The same problem with 2.18.0.
After that, the error disappeared:
"You should load the tensorflow.lite model using:
interpreter = tf.lite.Interpreter(model_path=tflite_model_path, experimental_preserve_all_tensors=True)
..."
I have a piece of code that extracts embeddings. This works perfectly fine
tensorflow==2.16.1
, but starts to break ontensorflow==2.17.0
. I'm not sure why it starts to throw this error. The tensorflow changelog doesn't show anything egregious: https://github.com/tensorflow/tensorflow/releases/tag/v2.17.0The workaround is to pin tensorflow to the last known working version.
The text was updated successfully, but these errors were encountered: