Open dthphuong opened 5 years ago
Hello -
I'm also facing the above issue. any fix available ?
Thanks, Diwahar
@giulbia @dsivaraj any ideas here?
I am getting:
pi@homeassistant:/opt/baby_cry_rpi $ sudo script/run.sh
Welcome to Parenting 2.1
Start Recording...
Recording WAVE '/opt/baby_cry_rpi/recording/signal_9s.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
Predicting...
What is the prediction? Traceback (most recent call last):
File "/opt/baby_cry_rpi/script/make_prediction.py", line 12, in <module>
from baby_cry_detection.rpi_methods import Reader
ImportError: No module named baby_cry_detection.rpi_methods
Prediction is 0
State of the Process PREDICTION = 0, PLAYING=0, # TIMES MY BABY CRIED=0
It do not help to install this:
sudo easy_install baby_cry_detection-1.1-py3.8.egg
Hi all, easy_install won't work. Are you sure that you have the latest version of code on your raspberry pi?
I can confirm this. I just pulled the latest docker image, the latest code from Github, and I built the .egg file as described here: https://github.com/giulbia/baby_cry_detection/issues/20
I've also copied the model file and the .egg file into the right directories inside the pi. Still, I'm getting this error. Any clues for how to proceed? Any help appreciated!
Btw, what a super awesome project! 👏
Update, the reason this happens is likely because the file reference to your .egg file is hardcoded to baby_cry_detection-1.1-py2.7.egg
inside https://github.com/giulbia/baby_cry_detection/blob/master/baby_cry_detection/rpi_main/make_prediction.py so you have to change that string to whatever filename you generate.
However, after fixing this I got another issue:
Predicting...
What is the prediction? /usr/local/lib/python2.7/dist-packages/librosa/__init__.py:40: DeprecationWarning: You are using librosa with Python 2. Please note that librosa 0.7 will be the last version to support Python 2, after which it will require Python 3 or later.
DeprecationWarning)
Traceback (most recent call last):
File "/opt/baby_cry_rpi/script/make_prediction.py", line 97, in <module>
main()
File "/opt/baby_cry_rpi/script/make_prediction.py", line 71, in main
model = pickle.load(fp)
File "/usr/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 864, in load
dispatch[key](self)
File "/usr/lib/python2.7/pickle.py", line 1096, in load_global
klass = self.find_class(module, name)
File "/usr/lib/python2.7/pickle.py", line 1130, in find_class
__import__(module)
ImportError: No module named _data
I'd guess this has something to do with the fact that the .egg file I created was made with python 3.7. And the docker file presumably runs python 2 ? Would it be possible to have a look at the docker file?
Hi @sslash,
Thanks for your messages, I'm glad you enjoy the project! The package name shouldn't be hard coded, I should improve that bit, thanks for pointing it out.
Everything was coded in Python 2.7 indeed so I guess there can be incompatibility problems. Here I have a version of the DockerFile. It is not precisely the one actually used but pretty similar. I need to find the original one, it was on a colleague's Github but it seems like it's not public anymore. Let me know if it helps.
Aha! Yeah so I've sort of given up making the dockerfile work for python 3. Too many roadblocks, haha!
I'm now trying to run everything on my rasp Pi, which has Python 2.7. The problem I face now is that the dependencies in setup.py
('numpy', 'librosa'
) do not have strict versions, so pip is trying to install the latest versions for both. Which does not work with python 2.7.
Any chance you still have the pinned version you used when you were last working on this? I thiiiink you could just do pip show numpy
and pip show librosa
🙏
For numpy
I don't know anymore but for librosa
it should be librosa==0.4.3
.
Unfortunately since I moved I don't know where's my pi anymore so I can't physically check :/
Thanks, @giulbia! I'll give that an attempt.
Hello, has anyone finally solved this problem ?
anybody final solve this question?
anybody solde this question?
Hi,
I try to run this project on my RPi 3B+. I installed all necessary libraries but a meet the following error:
How can I fix it ?
Best regards, Phuong Duong.