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

How to use cpu to run the torch code. #15

Closed
xiaogangLi opened this issue Sep 4, 2017 · 3 comments
Closed

How to use cpu to run the torch code. #15

xiaogangLi opened this issue Sep 4, 2017 · 3 comments

Comments

@xiaogangLi
Copy link

There is no GPU on my computer. How to use cpu to run the torch code. I have set gpu to -1, but still got error: module 'cunn' not found: No LuaRocks module found for "cunn".

@jwyang
Copy link
Owner

jwyang commented Sep 4, 2017

Hi, @xiaogangLi ,

This code is expected to run on GPU. If you have no GPUs, you might need to change the code a little bit.

The first place I can see is line 145:

 model:add(dofile('models_def/'..opt.dataset..'.lua')):cuda()

You need to remove :cuda() from this line.

Also, you might need to comment all "require cunn" and "require cudnn" from the code.

Please let me know if you have any more questions on this code.

@xiaogangLi
Copy link
Author

Thank you! Now, I want to compile lua-knn , but without gpu. What should I do?

@jwyang
Copy link
Owner

jwyang commented Sep 6, 2017

@xiaogangLi , I think you can directly use torch to implement knn.

@jwyang jwyang closed this as completed Sep 28, 2017
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

2 participants