mcguirepr89 / BirdNET-Pi

A realtime acoustic bird classification system for the Raspberry Pi 4B, 3B+, and 0W2 built on the TFLite version of BirdNET.
Other
1.28k stars 137 forks source link

birdnetpi server.py[...]: ModuleNotFoundError: No module named 'tensorflow' #170

Closed PeterEwertz closed 2 years ago

PeterEwertz commented 2 years ago

I set up my second BirdNet-Pi today. (The first ran out of the box. Thank you for your great work.) On a whim, I set the locale on the second Pi to LANG=de_DE.UTF-8. This led to the Python version being determined in the installation script with python_version= Apr 2021 /usr/bin/python3 -> python3 :-1: , which sabotaged the installation of the correct tensorflow version. After some searching I found that the $2 assignment in python_version="$(awk -F. '{print $2}' <(ls -l $(which /usr/bin/python3)))" in my case, pointed to the file date of the file.

birdnetpi-2:~/BirdNET-Pi$ ls -l /usr/bin/python3
lrwxrwxrwx 1 root root 9  5. Apr 2021  /usr/bin/python3 -> python3.9

Maybe an idea would be the version with: python_version="$(awk -F. '{print $2}' <(/usr/bin/python3 --version))" to assign?

mcguirepr89 commented 2 years ago

Hello, @Peter-1955 -- Thank you SO much for your interest in and kind words about BirdNET-Pi! I'm so glad that your first installation went well and that you are interested in getting the installation up and running in German.

Likewise thank you so much for getting to the bottom of the problem. Your solution is definitely the way to go, BUT I think that you've actually identified a relic of the installation script from when I was supporting both Debian Buster and Bullseye at the same time. Since I've decided to only support Bullseye, the installation script should always opt for python 3.9 (since it is the default python installation for Bullseye). I will likely simply hard-code the version number going forward since it was originally only used to decide which pre-built binaries to install from the TFLite wheels that were once included for python 3.7 and python 3.9. The repo now only has the TFLite pre-built binary wheel for version 3.9, so if 3.7 were detected, the installation would also fail in the same fashion.

I JUST moved to a new home and JUST got internet service at my new place, so once I've been able to put these changes in place and test an installation out myself, I will certainly be sure to update this issue and will close it at that point.

My best regards and gratitude for your contribution! Patrick

PS May I assume that your installation will be listening in Germany?

mcguirepr89 commented 2 years ago

Hello, again!

I have been able to take another look an I've already removed the python_version variable in the installer for version newif 0.13, so it will be fixed going forward (for what it is worth, none of the folks who use a German installation for the alpha and beta testing have reporting this issue, so it seems like it is indeed already fixed :tada:, so that's great!

Like I mentioned earlier, I'll keep this open until I've done the merge and the issue has been address on the main branch.

My best regards, Patrick

PeterEwertz commented 2 years ago

Hello Patrick @mcguirepr89, thank you very much for your quick reaction! In the meantime I have switched my second BirdNET-Pi to en_GB.UTF-8. He's running now.

You guessed right: I live in Krefeld. That's a medium-sized town in Germany, about 50 km away from Cologne. I am involved in projects for civic urban development. One of these projects is about positively influencing the inner-city climate with a herb wall (in german "Kräuterwand"). I would like to accompany this project regarding the impact on the fauna. Similar to @oldgristmill, I would therefore be interested in expanding the project to include insect and bat observation.

My goal is to document the effect of such measures with a cluster of BirdNET-Pi's at comparable locations.

I hope that I can bring my professional experience from the commercial application under Linux with the programming language C and with SQL databases into the amazing BirdNET-Pi project.

Best regards, Peter

sorry for my google translated english, but it is much better than my school english

mcguirepr89 commented 2 years ago

@Peter-1955 What a great plan! Krefeld is lucky to have a thinker like you ~~

I think your vision is wonderful -- Bird presence, especially when taking into account each species' typical diet, will certainly give you an idea of which/when insects have arrived/returned to the area. Be careful, though -- once birds and insects get a taste for fresh herbs, they refuse to eat anything that's not well-seasoned!! JK, I can't resist the opportunity for a dad joke :)

A helpful note when clustering the BirdNET-Pi nodes: if they will all be on the same network, give them each distinct hostnames and the installation will utilize the Pi's unique hostname when announcing its mDNS avahi-alias :)

I hope that I can bring my professional experience from the commercial application under Linux with the programming language C and with SQL databases into the amazing BirdNET-Pi project.

Welcome!!!! :tada: I'm very excited to welcome you to the community! The Venn diagram for Linux lovers and bird lovers has a small overlapping region, and you found it! I must say, it's a pretty cool place to tinker :)

My best regards, Patrick