im2markup icon indicating copy to clipboard operation
im2markup copied to clipboard

Want to train and test on CPU

Open bernardcwj opened this issue 7 years ago • 3 comments

I wish to test the model on a CPU, how can i achieve that? I have tried setting the gpd_id as 0 but it returns an error stating spatialconvolution requires cuda. Therefore, i included a line cudnn.convert(model[1], nn) in model.lua before line 55 to overcome the error. But now i'm getting another error:

 bad argument #2 to '?' (number expected, got userdata)
stack traceback:
        [C]: in ?
        [C]: in function '__add'
        ../im2markup/src/model/model.lua:593: in function 'feval'
        ../im2markup/src/model/model.lua:887: in function 'step'
        ../im2markup/src/train.lua:111: in function 'train'
        ../im2markup/src/train.lua:291: in function 'main'
        ../im2markup/src/train.lua:297: in main chunk

Any help is appreciated! Thanks

bernardcwj avatar Jan 10 '18 15:01 bernardcwj

@bernardcwj @da03 Do you find a way to solve this problem?

longzaitianguo avatar Apr 09 '18 09:04 longzaitianguo

Hmm a simple workaround is to just use modules from nn instead of cudnn, but I think training on CPU would be too slow to be realistic.

da03 avatar Apr 09 '18 14:04 da03

I am training it on cpu, one epoch spends 5 hours

jellchou avatar Jun 19 '20 07:06 jellchou