Wednesday, April 6, 2016

Getting eclilpse debugger working on torch

I have learned today that installing torch on eclilpse could be a little daunting, however, could also be very powerful.

I wanted to install this library
https://github.com/karpathy/neuraltalk2

with a debugger on eclipse since I have heard it has the best debugger.

I followed this instructions to do that:

http://www.lighting-torch.com/2015/07/27/configuring-eclipse-with-torch/

This are very detailed instructions and if you are lucky it should just work right off the butt.
However, I wasn't that lucky and I did end up doing some trial and error things.

I had an issue with getting qlua running on eclipse as an interpreter. I had some weird errors such as
qlua: ./misc/DataLoaderRaw.lua:45: attempt to index global 'path' (a nil value)
Which I wasn't sure what they were.

I googled around and first I made sure the environement was installed

sudo luarocks install env

to call it with qlua -lenv as I was doing previously.
what it really helped is to install
sudo luarocks install penlight

and add

local path = require 'pl.path'

to all the scripts that needed it. For some reason that was the main cause of my problems. I am a newbie at torch but for now I am happy with torch and my debugger.

Also for this particular library, it uses cunn and gpu which requires having cudnn installed and on the ld library path.
Hence in order to have this working I needed to go to Run->Run Configureations->Environement
I create a new variable called LD_LIBRARY_PATH
and give it a path something like this:
 /usr/include/python2.7/:/usr/local/cuda-7.5/lib64:/lib:/usr/local/lib/:/home/onina/cuda/cudann/lib64: