Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Want to train and test on CPU #7

Open
bernardcwj opened this issue Jan 10, 2018 · 3 comments
Open

Want to train and test on CPU #7

bernardcwj opened this issue Jan 10, 2018 · 3 comments

Comments

@bernardcwj
Copy link

bernardcwj commented Jan 10, 2018

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

@longzaitianguo
Copy link

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

@da03
Copy link
Collaborator

da03 commented Apr 9, 2018

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.

@jellchou
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants