LearnedVector / A-Hackers-AI-Voice-Assistant

A hackers AI voice assistant, built using Python and PyTorch.
https://www.youtube.com/playlist?list=PL5rWfvZIL-NpFXM9nFr15RmEEh4F4ePZW
MIT License
1.02k stars 358 forks source link

How to run this on cpu #27

Open MrWD10 opened 4 years ago

MrWD10 commented 4 years ago

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?

KnifeOfDunwall commented 4 years ago

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

MrWD10 commented 4 years ago

@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 commented 4 years ago

@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 notifications@github.com 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 .

KnifeOfDunwall commented 4 years ago

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

MrWD10 commented 4 years ago

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 notifications@github.com 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 commented 4 years ago

@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

KnifeOfDunwall commented 4 years ago

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

MrWD10 commented 4 years ago

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 notifications@github.com 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 .

XlentAcademy commented 4 years ago

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)'

urdaibayc commented 3 years ago

@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

XlentAcademy commented 3 years ago

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 notifications@github.com 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 .

Jochen-sys commented 3 years ago

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