griegler/octnet

error when loading the octree data??

eriche2016 opened this issue · 2 comments

below is the script i am doing testing stuff on loading octree data:

package.path  = package.path ..  ';'.. '/home/name/project/octnet/th/oc/init.lua'
require 'oc'
data_cpu = oc.FloatOctree() -- works okay 
data_cpu:read_from_bin_batch({'./test_octrees/chair_128.oc'}) -- okay 
data_cpu:data( )  -- error!!!

It gives the following error. can you fix it??

octnet/th/oc/octree.lua:300: attempt to index global 'th' (a nil value)
stack traceback:
        ...w/project_work_on/shape_research/octnet/th/oc/octree.lua:300: in function 'data'
        [string "_RESULT={data_cpu:data() }"]:1: in main chunk
        [C]: in function 'xpcall'
        /home/hxw/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl'
        .../hxw/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk
        [C]: at 0x00406670

There seems to be an issue with th.THFloatStorage_free(tensor:cdata().storage) in octree.lua. The data()function is mainly intended for testing purposes. What are you trying to do, maybe there is a different way?

I resolved the issue by replacing th with oc.torch_cpu - apparently it was just a case of outdated naming.