hughperkins / clnn

OpenCL backend for Torch nn neural networks library
BSD 2-Clause "Simplified" License
126 stars 16 forks source link

torch/install/share/lua/5.1/nn/THNN.lua:109: bad argument #8 to 'v' (cannot convert 'number' to 'struct THClTensor *') #39

Closed tdons closed 8 years ago

tdons commented 8 years ago

Hey,

A change to torch/nn was made in this commit that results in errors when running the clnn tests: https://github.com/torch/nn/commit/26a5a7e504dc6e082cf8610e5c3c581e9649f53f

When running luajit -l clnn -e 'clnn.test()' I'm getting this error: torch/install/share/lua/5.1/nn/THNN.lua:109: bad argument #8 to 'v' (cannot convert 'number' to 'struct THClTensor *')

For anybody else reading this: I've fixed it by doing this because I'm not knowledgeable enough to make the necessary code changes to clnn

git clone https://github.com/torch/nn.git
cd nn
git co e07d84d0f90fdf9035166785889941a4271657cf # this is the commit prior to the breaking change
luarocks make rocks/nn-scm-1.rockspec 

For reference, the corresponding commit in torch/cunn that adds the necessary code to make it compatible is https://github.com/torch/cunn/commit/f03b92f27ac45ccf6e96962f746b7e471d8af161

Thanks a lot for all the work you've put into this library, by the way. It has enabled me to play around with neural-style :-)

hughperkins commented 8 years ago

Thanks! In theory this should be addressed in https://github.com/hughperkins/clnn/commit/765fa30fd80826e00a4454ad45e4bf6a7431a0ca

hughperkins commented 8 years ago

I've rolled back torch/cltorch to ~21 feburary. that makes this issue go away, hopefully.