kahst / BirdNET-Lite

TFLite version of BirdNET. Bird sound recognition for more than 6,000 species worldwide.
Other
147 stars 194 forks source link

Example fails to analyze: interpreter.invoke() fails to reshape #7

Closed CoreProduction closed 3 years ago

CoreProduction commented 3 years ago

I've followed the installation guidelines and come up against this error when trying to run analyze.py. It appears that there is a problem running reshape. Does anybody have any guidance on how best to proceed?

python3 analyze.py --i 'example/XC558716 - Soundscape.mp3' 
LOADING TF LITE MODEL... DONE!
READING AUDIO DATA... /home/pi/virt/lib/python3.7/site-packages/librosa/core/audio.py:165: UserWarning: PySoundFile failed. Trying audioread instead.
  warnings.warn("PySoundFile failed. Trying audioread instead.")
DONE! READ 46 CHUNKS.
ANALYZING AUDIO... Traceback (most recent call last):
  File "analyze.py", line 224, in <module>
    main()
  File "analyze.py", line 216, in main
    detections = analyzeAudioData(audioData, args.lat, args.lon, week, sensitivity, args.overlap, interpreter)
  File "analyze.py", line 158, in analyzeAudioData
    p = predict([sig, mdata], interpreter, sensitivity)
  File "analyze.py", line 120, in predict
    interpreter.invoke()
  File "/home/pi/virt/lib/python3.7/site-packages/tensorflow_core/lite/python/interpreter.py", line 454, in invoke
    self._interpreter.Invoke()
  File "/home/pi/virt/lib/python3.7/site-packages/tensorflow_core/lite/python/interpreter_wrapper/tensorflow_wrap_interpreter_wrapper.py", line 113, in Invoke
    return _tensorflow_wrap_interpreter_wrapper.InterpreterWrapper_Invoke(self)
RuntimeError: tensorflow/lite/kernels/reshape.cc:66 num_input_elements != num_output_elements (12928 != 144000)Node number 14 (RESHAPE) failed to invoke.
asross commented 3 years ago

I've got the same issue 😢

ghost commented 3 years ago

Have you tried to use the 64-bit version of Raspberry OS instead of setting the flag in the config.txt in the 32 bis system? https://downloads.raspberrypi.org/raspios_arm64/images/

CoreProduction commented 3 years ago

Closed - I eventually did a full reinstall on the Pi with Ubuntu 18.03