deepspeech.torch icon indicating copy to clipboard operation
deepspeech.torch copied to clipboard

change model from gpu to cpu

Open fanlamda opened this issue 8 years ago • 5 comments

I wish to train the model on GPU,but predict with cpu,so I tried using cudnn.convert(self.model, nn). But it seems something in the model remains Cuda form.

Is there any method to solve this problem? Any advice is welcome.

fanlamda avatar Nov 02 '16 08:11 fanlamda

In order to switch back to CPU mode you would also need to call self.model:float() as well as cudnn.convert(self.model, nn).

SeanNaren avatar Nov 02 '16 11:11 SeanNaren

Yes,I used self.model:float() After cudnn.convert(), but I found cudnn.batchBRNNReLU remains unchanged. It comes error like 'unknown object cudnn.batchBRNNReLU'

fanlamda avatar Nov 02 '16 11:11 fanlamda

Ah this is my fault there is no CPU version of cudnn.BatchBRNNReLU. I'll have to modify the DeepSpeechModel class to take this into consideration; the alternative is to use the rnn package seqBRNN which will allow conversion, which will involve having to train a new model

SeanNaren avatar Nov 03 '16 14:11 SeanNaren

I'm training a smaller model on AN4 that is CPU based (but training on GPU with a few hacks). Will add this to the pre-trained networks once finished.

SeanNaren avatar Jan 05 '17 15:01 SeanNaren

I dont have a gpu , I am still learning , Is there any small pretrained model that will work with only cpu(core i5 of my laptop and raspberry pi 3 ? )

saurabhvyas avatar Mar 18 '17 12:03 saurabhvyas