pddpauw / BirdPi

A realtime acoustic bird classification system for the Raspberry Pi 5, based on BirdNET-Pi
Other
30 stars 6 forks source link

BirdNET-Pi not working anymore #3

Closed migrations closed 7 months ago

migrations commented 7 months ago

Hi, I have a PI5 setup working properly for a few week. This morning i was looking around the system and found in settings that there where updates avaiable. From that point the BirdNET didn't analyze the sounds anymore. This afternoon a did a full re-install (by putting a brand new raspberry image on my SD card and installing BirdnetPI again from this repo). I still receive the same error, see below.

Thanks Gerard

15:08:16---Files loaded 15:08:17---RECORDING_LENGTH set to 15 15:08:17---BirdNET-Pi/birdnet/bin/python3 BirdNET-Pi/scripts/analyze.py --i BirdSongs/February-2024/13-Tuesday/2024-02-13-birdnet-14:57:23.wav --o BirdSongs/February-2024/13-Tuesday/2024-02-13-birdnet-14:57:23.wav.csv--lat 52.XX --lon 5.XX --week 6 --overlap 0.0 --sensitivity 1.25 --min_conf 0.7 15:08:17---LOADING TF LITE MODEL... DONE! 15:08:17---READING AUDIO DATA... BirdNET-Pi/birdnet/lib/python3.11/site-packages/numpy/core/getlimits.py:549: UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero. 15:08:17--- setattr(self, word, getattr(machar, word).flat[0]) 15:08:17---BirdNET-Pi/birdnet/lib/python3.11/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero. 15:08:17--- return self._float_to_str(self.smallest_subnormal) 15:08:17---BirdNET-Pi/birdnet/lib/python3.11/site-packages/numpy/core/getlimits.py:549: UserWarning: The value of the smallest subnormal for <class 'numpy.float32'> type is zero. 15:08:17--- setattr(self, word, getattr(machar, word).flat[0]) 15:08:17---BirdNET-Pi/birdnet/lib/python3.11/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for <class 'numpy.float32'> type is zero. 15:08:17--- return self._float_to_str(self.smallest_subnormal) 15:08:18---DONE! READ 5 CHUNKS. 15:08:18---Date-time: 2024-02-13 14:57:23 15:08:18---ANALYZING AUDIO... Exception in thread Thread-1 (handle_client): 15:08:18---Traceback (most recent call last): 15:08:18--- File "/usr/local/bin/server.py", line 129, in predictFilter 15:08:18--- if M_INTERPRETER is None: 15:08:18--- ^^^^^^^^^^^^^ 15:08:18---NameError: name 'M_INTERPRETER' is not defined. Did you mean: 'INTERPRETER'? 15:08:18---During handling of the above exception, another exception occurred: 15:08:18---Traceback (most recent call last): 15:08:18--- File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner 15:08:18--- self.run() 15:08:18--- File "/usr/lib/python3.11/threading.py", line 975, in run 15:08:18--- self._target(*self._args, **self._kwargs) 15:08:18--- File "/usr/local/bin/server.py", line 460, in handle_client 15:08:18--- detections = analyzeAudioData(audioData, args.lat, args.lon, week, sensitivity, args.overlap) 15:08:18--- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 15:08:18--- File "/usr/local/bin/server.py", line 283, in analyzeAudioData 15:08:18--- predictSpeciesList(lat, lon, week) 15:08:18--- File "/usr/local/bin/server.py", line 163, in predictSpeciesList 15:08:18--- l_filter = explore(lat, lon, week) 15:08:18--- ^^^^^^^^^^^^^^^^^^^^^^^ 15:08:18--- File "/usr/local/bin/server.py", line 147, in explore 15:08:18--- l_filter = predictFilter(lat, lon, week) 15:08:18--- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 15:08:18--- File "/usr/local/bin/server.py", line 132, in predictFilter 15:08:18--- loadMetaModel() 15:08:18--- File "/usr/local/bin/server.py", line 109, in loadMetaModel 15:08:18--- M_INTERPRETER = tflite.Interpreter(model_path=userDir + '/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_FP16.tflite') 15:08:18--- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 15:08:18--- File "BirdNET-Pi/birdnet/lib/python3.11/site-packages/tflite_runtime/interpreter.py", line 464, in init 15:08:18--- self._interpreter = _interpreter_wrapper.CreateWrapperFromFile( 15:08:18--- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 15:08:18---ValueError: Model provided has model identifier '

TataGEEK commented 7 months ago

Hi, I was getting a very similar error since yesterday morning. Same setup with rPi5. I don't have the full log, but I know that the error statement ended with text:

ValueError: Model provided has model identifier 

I tried manually running:

sudo apt-get update
sudo apt-get upgrade

Since then I see the following error:

17:30:25---    detections = analyzeAudioData(audioData, args.lat, args.lon, week, sensitivity, args.overlap)
17:30:25---                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17:30:25---  File "/usr/local/bin/server.py", line 297, in analyzeAudioData
17:30:25---    p = predict([sig, mdata], sensitivity)
17:30:25---        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17:30:25---  File "/usr/local/bin/server.py", line 247, in predict
17:30:25---    INTERPRETER.invoke()
17:30:25---  File "BirdNET-Pi/birdnet/lib/python3.11/site-packages/tflite_runtime/interpreter.py", line 941, in invoke
17:30:25---    self._interpreter.Invoke()
17:30:25---RuntimeError: Select TensorFlow op(s), included in the given model, is(are) not supported by this interpreter. Make sure you apply/link the Flex delegate before inference. For the Android, it can be resolved by adding "org.tensorflow:tensorflow-lite-select-tf-ops" dependency. See instructions: https://www.tensorflow.org/lite/guide/ops_selectNode number 29 (FlexRFFT) failed to prepare.
pddpauw commented 7 months ago

Thx, will look at this later this evening. I had changed the model to V2.4 V2, and this might have caused it.

pddpauw commented 7 months ago

ok, I really don't know what is causing this... I reverted some changes on the model, but don't think this was the issue: tried with a fresh installation, but getting the same errors. I've also tried to copy working model libraries from on (working) Pi to the other (non-working) Pi, but this doesn't resolve the issue neither.

I know some scripts update dependencies, so maybe this is the rootcause...?

I'm really stuck on this one, so thoughts/ideas welcome!

TataGEEK commented 7 months ago

Yesterday at approximately 9:00 p.m., I saw you making some changes. There were 7 updates in Tools > System controls. So I tried to install it. The installation ran for an hour and the time kept adding up. When I went to the home page of my BirdNet-Pi, there was only the logo and the menu and other content was missing. I wanted to go to sleep already. SSH was working, so I did a reboot. I have been bug free since then and have 349 detections and 18 different species for today.

There are now 5 updates in the system controls, but I won't click on that, I'm glad everything works. I don't know if it was a fluke and I hit a working combination. Unfortunately I don't have enough knowledge to be of any other help.

I still remember that before the update (the one that fixed it) I cleaned up the old packages with sudo apt-get autoremove

pddpauw commented 7 months ago

yes, made several changes last night, but wanted to check all is working before confirming. Made fresh installation, and seems to work. I've set the version to V2.4 during installation. Enjoy, Pieter