baby_cry_detection
baby_cry_detection copied to clipboard
Training problem under windows OS
Hello,
When I try to run train_set.py I get below error message
C:\baby_cry_detection-master\pc_main>train_set.py Traceback (most recent call last): File "C:\baby_cry_detection-master\pc_main\train_set.py", line 5, in <module> import numpy as np ModuleNotFoundError: No module named 'numpy'
And If I try to install numpy module I get following error message `C:\baby_cry_detection-master\pc_main>python -m pip install numpy Collecting numpy Could not find a version that satisfies the requirement numpy (from versions: ) No matching distribution found for numpy
C:\baby_cry_detection-master\pc_main>`
My questions are: 1- Is there any way I can train on my Windows computer? I prefer it because it is powerful with i7 CPU. 2- If I am to run train_set.py in Raspberry Pi, with latest about 60 audio files to train. How long I can expect it to finish training?
Thank you.
Hi,
I've never tried to run it on Windows OS but there's no reason why it shouldn't work.
Why do you do python -m pip install numpy
? I'd rather do a simple pip install numpy
. Also, what distribution of python are you working with ? I'm using python 2.7 installed with Anaconda. The advantage of anaconda, is that it comes with a lot of preinstalled packages, numpy being one of them.
As for your second question, I am afraid that training the model on a reduced train set would degrade a lot its performance. I don't know how much time it could take, the feature engineering step is already expensive at prediction time on only one signal (it takes about 30 seconds on my Raspberry Pi to record the signal, cut it, derive features, and apply the model).
I am a total newbie to Python. I saw python -m pip install numpy
command on the internet and used it. I just try pip install numpy
and it started to download a package. I will continue and see if I will have any more issues.
I didn't ask about reduced train set. Actually, I asked how long it takes to process sound files and create fingerprint files in terms of hours. I think you provided about 60 cry files.
All right, as soon as numpy is installed. I tried it and having below error. As I do not know python, Unfortunately, I couldn't see how to fix it.
C:\baby_cry_detection-master\pc_main>train_set.py
Traceback (most recent call last):
File "C:\baby_cry_detection-master\pc_main\train_set.py", line 10, in <module>
from pc_methods import Reader
ModuleNotFoundError: No module named 'pc_methods'
C:\baby_cry_detection-master\pc_main>
What I observe is that I am running script under pc_main
directory and it is trying to import another directory which is one level up. That might be totally wrong though.
What I observe is that I am running script under pc_main directory and it is trying to import another directory which is one level up. That might be totally wrong though.
I see you are running your code from inside the pc_main folder. You should launch it from the its parent folder baby_cry_detection-master as follows: python pc_main/train_set.py
.
I didn't ask about reduced train set. Actually, I asked how long it takes to process sound files and create fingerprint files in terms of hours. I think you provided about 60 cry files.
There are 108 fragments 5 second long in the training set. On the Raspberry Pi, I record a 9 second long signal, I cut it in 5 fragments 5 second long, I process and make a prediction on each of them. Only if at least 3 out of 5 is predicted as a baby cry I actually assume it is really a baby cry. This process takes about 1 minute and a half on my Raspberry Pi. I still need to speed up this step. I hope I answered your question.
It seems I am having same error about module even if I try to call train_set.py from an upper directory.
C:\baby_cry_detection-master>python pc_main/train_set.py
Traceback (most recent call last):
File "pc_main/train_set.py", line 10, in <module>
from pc_methods import Reader
ModuleNotFoundError: No module named 'pc_methods'
C:\baby_cry_detection-master>
Is there anything else I can try?
I'm not sure what's wrong. Let's try to check something.
In baby_cry_detection/pc_methods/__init__.py
, do you have class Reader
?
Yes, there is Reader class in pc_methods/__init__.py
However, pc_main/__init__.py
is an empty file. If that is not normal, there is something wrong I did while getting the latest branch from github.