mayank-git-hub / ETE-Speech-Recognition

Implementation of Hybrid CTC/Attention Architecture for End-to-End Speech Recognition in pure python and PyTorch
Apache License 2.0
26 stars 2 forks source link

Use CPU to train and evaluate the model #3

Closed TheisTrue closed 4 years ago

TheisTrue commented 4 years ago

Hi! How do I need to modify the code to just use CPU to train and evaluate the model?

mayank-git-hub commented 4 years ago

I have made the necessary changes in the latest commit. Just set use_cuda in specific_config to False.

But personally I don't see the point of training using CPU, it is going to take a lot of time!

TheisTrue commented 4 years ago

So I gave it a try and here are the results: RuntimeError: get_device is not implemented for tensors with CPU backend

I also want to use GPU, but my GPU is only 2G……

mayank-git-hub commented 4 years ago

Try to use torch==1.1.0, I have also updated the requirements.txt.

I doubt you will be able to use a GPU with 2GB. You can try to lower the batchsize in the config file.

TheisTrue commented 4 years ago

Thank you, you'vebeen most helpful. I can use the CPU to run the code. I've tried to use GPU, but I set batchsize to 1, which is also out of memory

mayank-git-hub commented 4 years ago

Glad to be of help!

Yeah I suspected it won't work even with batchsize=1.