Open max-mapper opened 4 months ago
As a follow up request, maybe you can publish your working docker image to the docker hub?
Same issue here on Windows:
Traceback (most recent call last):
File "D:\misc\battybirdnet analyzer\bat_ident.py", line 279, in analyze_file
prediction = predict(samples)
^^^^^^^^^^^^^^^^
File "D:\misc\battybirdnet analyzer\bat_ident.py", line 217, in predict
prediction = model.predict(data)
^^^^^^^^^^^^^^^^^^^
File "D:\misc\battybirdnet analyzer\model.py", line 308, in predict
return predictWithCustomClassifier(sample)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\misc\battybirdnet analyzer\model.py", line 351, in predictWithCustomClassifier
feature_vector = embeddings(sample)
^^^^^^^^^^^^^^^^^^
File "D:\misc\battybirdnet analyzer\model.py", line 387, in embeddings
features = INTERPRETER.get_tensor(OUTPUT_LAYER_INDEX)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow\lite\python\interpreter.py", line 888, in get_tensor
return self._interpreter.GetTensor(tensor_index, subgraph_index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Tensor data is null. Run allocate_tensors() first
Running analyze.py works fine, until I add a --classifier parameter
I noticed the upstream Dockerfile is practically identical https://github.com/kahst/BirdNET-Analyzer/blob/main/Dockerfile. I just tested building it and it worked. So it must not be a problem with the Dockerfile in this repo...
$ docker build -t birdnet .
$ docker run -v $PWD/example:/audio birdnet analyze.py
Species list contains 6522 species
Found 1 files to analyze
Analyzing example/soundscape.wav
zINFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Finished example/soundscape.wav in 13.56 seconds
I noticed the upstream Dockerfile is practically identical https://github.com/kahst/BirdNET-Analyzer/blob/main/Dockerfile. I just tested building it and it worked. So it must not be a problem with the Dockerfile in this repo...
$ docker build -t birdnet . $ docker run -v $PWD/example:/audio birdnet analyze.py Species list contains 6522 species Found 1 files to analyze Analyzing example/soundscape.wav zINFO: Created TensorFlow Lite XNNPACK delegate for CPU. Finished example/soundscape.wav in 13.56 seconds
Have you tried running bat_ident.py instead of analyze.py? I get the allocate_tensors error with the first, but not with the latter.
Hi, I am trying to run the bat_ident.py on Arch Linux. I did the following:
But it printed e.g.
Error: Cannot analyze audio file /home/bats/NoID_20240726_211812.wav.
. After patching https://github.com/rdz-oss/BattyBirdNET-Analyzer/blob/0412be3c081126ef973438c9de1304311f2ab996/bat_ident.py#L473 to/home/bats/error.log
I could see the full error:I can see in the code that
allocate_tensors()
is always run aftertflite.Interpreter()
calls so I'm not sure whats going on, maybe a version mismatch from the known working version (since the dockerfile installs the latest of everything)?