jcjohnson / torch-rnn

Efficient, reusable RNNs and LSTMs for torch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

train.lua looks for cutorch even though "-gpu 0"

wsanders opened this issue · comments

# th train.lua -input_h5 data/tiny-shakespeare.h5  -input_json data/tiny-shakespeare.json -gpu 0
/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/trepl/init.lua:389: module 'cutorch' not found:No LuaRocks module found for cutorch

I think you mean
if opt.gpu > 0 and opt.gpu_backend == 'cuda' then
and not
if opt.gpu >= 0 and opt.gpu_backend == 'cuda' then

You need to specify -gpu -1 to train on the CPU. GPU numbers are zero-based in torch-rnn.

Yes -gpu -1 will execute code in CPU mode. For more about command line argument passed to it
Look - https://github.com/jcjohnson/torch-rnn/blob/master/doc/flags.md#training