A-Hackers-AI-Voice-Assistant icon indicating copy to clipboard operation
A-Hackers-AI-Voice-Assistant copied to clipboard

How to run this on cpu

Open MrWD10 opened this issue 4 years ago • 12 comments

i want to train this model using cpu instead of gpu.under speech recognition folder------>in train.py what should I change in code to work it properly?

MrWD10 avatar Nov 02 '20 19:11 MrWD10

It has a line of code that uses gpu if available and cpu if not. I'm currently on my phone and cannot give you specific details where it is but it should be in train.py. You need to change that line so that it always uses cpu

KnifeOfDunwall avatar Nov 03 '20 01:11 KnifeOfDunwall

@KnifeOfDunwall train.py under speech recognition folder does not contain such lines. it will be really great if you could manage some time to look into this issue.

MrWD10 avatar Nov 03 '20 05:11 MrWD10

@KnifeOfDunwall https://github.com/KnifeOfDunwall train.py under speech recognition folder does not contain such lines. it will be really great if you could manage some time to look into this issue.

On Tue, Nov 3, 2020 at 6:51 AM KnifeOfDunwall [email protected] wrote:

It has a line of code that uses gpu if available and cpu if not. I'm currently on my phone and cannot give you specific details where it is but it should be in train.py. You need to change that line so that it always uses cpu

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LearnedVector/A-Hackers-AI-Voice-Assistant/issues/27#issuecomment-720858328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN4XLELUXZI7NHPN5SLCLDSN5O3RANCNFSM4TH3DPIA .

MrWD10 avatar Nov 03 '20 09:11 MrWD10

youre right, it was in the train.py of the wakeword. try to do this.

KnifeOfDunwall avatar Nov 03 '20 12:11 KnifeOfDunwall

And what about train.py of speech recognition. They don't use that method(cuda if device available). I guess by changing value of GPU to 0 from 1 will do the trick...?

On Tue, Nov 3, 2020, 5:42 PM KnifeOfDunwall [email protected] wrote:

youre right, it was in the train.py of the wakeword. try to do this https://stackoverflow.com/questions/54544986/need-to-change-gpu-option-to-cpu-in-a-python-pytorch-based-code .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LearnedVector/A-Hackers-AI-Voice-Assistant/issues/27#issuecomment-721093180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN4XLHYWKANHZ7FVMI3HXLSN73EZANCNFSM4TH3DPIA .

MrWD10 avatar Nov 03 '20 13:11 MrWD10

@KnifeOfDunwall will this repo will run on google colab? because some of its libraries do not operate in windows i.e torchaudio....... when I try to run it in colab I got these errors, don't know why.....can you help me...? Screenshot from 2020-11-04 04-56-16

MrWD10 avatar Nov 04 '20 00:11 MrWD10

I dont know how to use colab. you should ask someone else as im new to this

KnifeOfDunwall avatar Nov 04 '20 20:11 KnifeOfDunwall

Then can you tell me how to resolve this issue: Exception: dual channel, skipping audio file (file_path) This exception is being generated from the dataset.py file under speechrecognition folder. The spectrogram is keep returning channel=2 which causes the above exception to raised. Can you help me solving this issue..?

On Thu, Nov 5, 2020 at 1:31 AM KnifeOfDunwall [email protected] wrote:

I dont know how to use colab. you should ask someone else as im new to this

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LearnedVector/A-Hackers-AI-Voice-Assistant/issues/27#issuecomment-721959248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN4XLFANFU5TJ4V3VWMWVLSOG22NANCNFSM4TH3DPIA .

MrWD10 avatar Nov 05 '20 03:11 MrWD10

So my friend, in google colab you have to disable the save_model_path or instead of args.save_model_path you should write '/content/(and here your dir path)'

XlentAcademy avatar Dec 01 '20 06:12 XlentAcademy

@KnifeOfDunwall will this repo will run on google colab? because some of its libraries do not operate in windows i.e torchaudio....... when I try to run it in colab I got these errors, don't know why.....can you help me...? Screenshot from 2020-11-04 04-56-16

did you do this? https://hackernoon.com/getting-started-with-pytorch-in-google-collab-with-free-gpu-61a5c70b86a

urdaibayc avatar Jan 05 '21 09:01 urdaibayc

No but i have a trained a wakeword model on google colab. Just use GPU instead of TPU your error will be solved.

On Tue, 5 Jan 2021 at 15:07, urdaibayc [email protected] wrote:

@KnifeOfDunwall https://github.com/KnifeOfDunwall will this repo will run on google colab? because some of its libraries do not operate in windows i.e torchaudio....... when I try to run it in colab I got these errors, don't know why.....can you help me...? [image: Screenshot from 2020-11-04 04-56-16] https://user-images.githubusercontent.com/39570348/98053891-780e6a80-1e5b-11eb-9bfa-078ac920e6bd.png

did you do this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LearnedVector/A-Hackers-AI-Voice-Assistant/issues/27#issuecomment-754522924, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARQ32JT3DEKUVX4PNMEGO6TSYLMXJANCNFSM4TH3DPIA .

XlentAcademy avatar Jan 12 '21 12:01 XlentAcademy

Hey I have a question left: The changing from gpu to cpu has been for wakeword detection and not for whole sentences?

Jochen-sys avatar Apr 27 '21 12:04 Jochen-sys