jwyang/JULE.torch

How to use cpu to run the torch code.

Closed this issue · 3 comments

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".

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.

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

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