griegler / octnet Goto Github PK
View Code? Open in Web Editor NEWOctNet: Learning Deep 3D Representations at High Resolutions
License: Other
OctNet: Learning Deep 3D Representations at High Resolutions
License: Other
Hi, thanks for your code. Is there a tool to 'visualize' the octree data?
Hi,
Could you please introduce what tools do you use for Octree visualization?
Thanks.
Is there any implementation of the segmentation module?
Increasing resolution obviously requires more memory. Using example 01 at 128^3 requires more memory than my GPU has. To try and reduce the memory footprint, I tried to reduce the batch size.
Testing at 64^3 shows that increasing the batch size causes out of memory errors, so reducing it should help.
However, setting the batch size to 16 causes an error "mismatch between the batch size of input (128) and that of target (16)". The first number varies with the batch size (size=12 is 96, ect). Unfortunately, tracing the callstack back out I see no place that the number would come from.
/home/tetragramm/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #2 to 'v' (mismatch between the batch size of input (96) and that of target (12) at /home/tetragramm/torch/extra/cunn/lib/THCUNN/generic/ClassNLLCriterion.cu:39)
stack traceback:
[C]: in function 'v'
/home/tetragramm/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'ClassNLLCriterion_updateOutput'
...amm/torch/install/share/lua/5.1/nn/ClassNLLCriterion.lua:44: in function 'updateOutput'
...torch/install/share/lua/5.1/nn/CrossEntropyCriterion.lua:20: in function 'forward'
../common.lua:170: in function 'opfunc'
/home/tetragramm/torch/install/share/lua/5.1/optim/adam.lua:37: in function 'optimizer'
../common.lua:180: in function 'train_epoch'
../common.lua:249: in function 'worker'
classification_common.lua:97: in function 'classification_worker'
train_mn10_r64.lua:66: in main chunk
[C]: in function 'dofile'
I'd be interested in making this into an extension for pytorch, if anyone is also working on this, or would like to help, please let me know
I am working on this data structure and I would like to know if it can be applied on .stl data type and if so what are the required changes
Hello,
Increasing the batch size seems to increase the time taken for processing the batch almost by a factor of batchsize.
The only thing which I feel which influences it is the n_grids parameter.
I calculated the memory used by the output octree at each step and I found that it should take around 1gb all combined for the forward pass per input. So considering backward and network parameters, the whole thing should not take more than 2.5gb. But changing n_grids it to -1 causes it to go out of memory.
Can you please help me out?
Thanks.
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
Hi, thank you for the source code!
The "build_all.sh" was successed. But when I tried the example00, I got errors.
When I use python3.5, I got:
Traceback (most recent call last):
File "create_data.py", line 16, in
import pyoctnet
ImportError: dynamic module does not define module export function (PyInit_pyoctnet)
And when I use python2.7, I got :
Traceback (most recent call last):
File "create_data.py", line 16, in
import pyoctnet
File "init.pxd", line 918, in init pyoctnet
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
Is it because the numpy version? Do you know what is the problem?
I saw I can write point cloud back from octree using ' vis.write_ply_voxels('oc_from_dense1.ply', oc_from_dense1.to_cdhw())' , Is there functions to write dense volume and mesh from octree?
Hi,
I'm trying to create octrees with pcl organised point clouds. What I'm stuck with is what does the ranges and number of ranges mean in the octree_create_from_dense_cpu mean in terms of point clouds and how I procure those from a raw point cloud. If possible. Could you post a code example on how to convert raw pcl pointclouds to octrees.
Hey,
I want to read octree using python since octree is generated using python itself,
pyoctnet.Octree.create_from_off
Could you please let me know whether there are any in-built functionalities for this(may be using pyoctnet or something else)
Or Do I need to read octree through Lua itself?
Also I am curious to know, whether you used 'oc' as package? If so what is the location of it? I am not able to find it.(sorry I don't have much idea on Lua)
Please help!!
Thanks,
Basavaraj
Hello,
I'm getting an error when I try to run example/00. I was able to successfully run example/01_classification_modelnet so I believe its related to some of the dense portions of the code (which is what I'm interested).
The error I get is:
octnet/example/00_create_data$ python2 create_data.py
Traceback (most recent call last):
File "create_data.py", line 33, in
oc_from_dense1 = pyoctnet.Octree.create_from_dense(dense, val_range, n_threads=n_threads)
File "pyoctnet.pyx", line 654, in pyoctnet.Octree.create_from_dense (pyoctnet.cpp:8805)
def create_from_dense(cls, float[:,:,:,::1] dense, bool fit=False, int fit_multiply=1, bool pack=False, int n_threads=1):
ValueError: Buffer has wrong number of dimensions (expected 4, got 3)
Modifying line 27 to add a 4th dimension with:
dense = np.zeros((vx_res,vx_res,vx_res,1), dtype=np.float32)
Leads to the following error:
Traceback (most recent call last):
File "create_data.py", line 33, in
oc_from_dense1 = pyoctnet.Octree.create_from_dense(dense, val_range, n_threads=n_threads)
File "pyoctnet.pyx", line 654, in pyoctnet.Octree.create_from_dense (pyoctnet.cpp:8807)
def create_from_dense(cls, float[:,:,:,::1] dense, bool fit=False, int fit_multiply=1, bool pack=False, int n_threads=1):
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Hi,
I tried using unorganised point clouds and I got this error at line 70 of OctreeConvolutionMM.lua
invalid input size, self.nInputPlane=1, input:feature_size()=3
I assume it's because unorganised point clouds do not have positional information of the points and hence are 1 * numofpoints instead of height * width
So I tried I using organised point clouds, and the code errors out giving before even loading the octrees completely.
feature_size of path 1 does not match in octree_read_batch_cpu (3, 1)
Both of them are related to the feature size and input plane mismatch which pushes me to believe that I'm doing a mistake while creating the octree.
I'm using python pcl to load point clouds and I convert them into numpy arrays before using create_octree_from_cpu.
import pcl
path = "./organisedpointclouds/cloud1.pcd"
p = pcl.load(path)
xyz = cloud
features = np.ones_like(xyz)
oc_from_pcl = pyoctnet.Octree.create_from_pc(xyz, features, vx_res, vx_res, vx_res, normalize=True,
n_threads=n_threads)
for idx in range(3):
xyz[..., idx] = (xyz[..., idx] - xyz[..., idx].min()) / (xyz[..., idx].max() - xyz[..., idx].min())
xyz[..., idx] *= vx_res
oc_from_pcl = pyoctnet.Octree.create_from_pc(xyz, features, vx_res, vx_res, vx_res, normalize=False,
n_threads=n_threads)
savePath = "./octrees/octree1.oc"
oc_from_pcl.write_bin(savePath)
cloud.zip
Hi,
When I run the script 'build_all.sh', The following error occurred:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (found suitable version "8.0", minimum required is "6.5") Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.5/Modules/FindCUDA.cmake:949 (find_package_handle_standard_args) CMakeLists.txt:42 (find_package)
However, torch and cuda work very well on my machine. Do you know how to fix this? Thanks very much!
After calling
input, target = data_loader:getBatch()
I am trying to resize the input variable.
local inputSz = input:size()
inputSz[1] = inputSz[1]*2
input:resize(inputSz)
The resulting error is this:
/home/master/torch/distro/install/bin/luajit: /home/master/octnet/th/oc/octree.lua:472: bad argument #1 to 'octree_resize_gpu' (cannot convert 'void *' to 'int')
stack traceback:
[C]: in function 'octree_resize_gpu'
/home/master/octnet/th/oc/octree.lua:472: in function 'resize'
From what I can see in dataloader.lua, it seems like I'm using it correctly, so I'm not sure what the problem is.
Thanks
Hi,
In your released model for classification, the first six convolution layers are OctreeConvolutions, while the last four are cudnn.VolumetricConvolutions. Why don't you set all convolutions as OctreeConvolutions?
I am also wondering if you are willing to release the exact model for semantic 3D point cloud labelling. Since I am very curious how it looks like.
Thanks very much!
Hi, I tried to run the create_data.py file in examples/00_create_data and I got the following error :
[OctreeCreateCpu] create octree structure
[OctreeCreateCpu] update octree data structure
[OctreeCreateCpu] fill data
[OctreeCreateCpu] done
Traceback (most recent call last):
File "./create_data.py", line 32, in <module>
oc_from_dense2 = pyoctnet.Octree.create_from_dense2(dense, dense[np.newaxis,...], n_threads=n_threads)
File "pyoctnet.pyx", line 644, in pyoctnet.Octree.create_from_dense2 (pyoctnet.cpp:8776)
def create_from_dense2(cls, float[:,:,::1] occupancy, float[:,:,:,::1] features, bool fit=False, int fit_multiply=1, bool pack=False, int n_threads=1):
File "stringsource", line 644, in View.MemoryView.memoryview_cwrapper (pyoctnet.cpp:23565)
File "stringsource", line 345, in View.MemoryView.memoryview.__cinit__ (pyoctnet.cpp:19800)
ValueError: ndarray is not C-contiguous
Thanks for the help !
Hi
I have successfully compiled the octnet code on my machine. However, while executing the examples, specifically while executing this script
th train_mn10_r64.lua
, I receive the following error
/home/siddharth/.luarocks/share/lua/5.1/hdf5/init.lua:15 Unable to find the HDF5 lib we were built against - trying to find it elsewhere
/home/siddharth/torch/install/bin/luajit: /home/siddharth/torch/install/share/lua/5.1/trepl/init.lua:389: /home/siddharth/.luarocks/share/lua/5.1/hdf5/ffi.lua:29: libhdf5.so: cannot open shared object file: No such file or directory
stack traceback:
[C]: in function 'error'
/home/siddharth/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
../common.lua:3: in main chunk
[C]: in function 'dofile'
classification_common.lua:1: in main chunk
[C]: in function 'dofile'
train_mn10_r64.lua:3: in main chunk
[C]: in function 'dofile'
...arth/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
Does the code have any specific dependency ?
similar to issue 5, I got initially the same error:
invalid input size, self.nInputPlane=1, input:feature_size()=3
but then when I used features = np.ones((1,xyz.shape[0]), dtype=np.float32)
no file was created in the preprocessed folder
Can you provide some examples about the usage of the python and torch wrapper? e.g., how to construct a CNN
Hi,
Recently I installed torch and ran the example code from train_mn10_r64.lua. There are 20 epochs and initial learning rate is 0.001 with batch size of 32 using Adam optimizer, everything is as default.
However, the test accuracy is only 0.457, as shown below:
[INFO] loading data took 0.005721[s] - n_batches 32
[INFO] net/crtrn fwd took 0.484423[s]
[INFO] test batch 29/29
[INFO] loading data took 0.004988[s] - n_batches 12
[INFO] net/crtrn fwd took 0.205677[s]
test_epoch=20, avg_f=0.457447
How can I achieve the accuracy as displayed in the octnet paper?
Thanks!
What method do I use in python to get the occupancy of an octree? I want to use that octree to create an octree of a different dense array to have to same structure as the first. I can see that create_from_dense_2 lets me do that, but I don't see a function to get the occupancy of the first octree.
Thank You
Could you provide the semantic segmentation code?
Hi, Firstly thanks for the prompt reply regarding the previous issue. I subsequently tried running the code in examples/01_classification_modelnet and I got this error:
~/octnet/distro/install/bin/luajit: ...hesis/octnet/distro/install/share/lua/5.1/trepl/init.lua:389: module 'cunn' not found:No LuaRocks module found for cunn
no field package.preload['cunn']
no file '../../th/cunn/init.lua'
no file '~/.luarocks/share/lua/5.1/cunn.lua'
no file '~/.luarocks/share/lua/5.1/cunn/init.lua'
no file '~/thesis/octnet/distro/install/share/lua/5.1/cunn.lua'
no file '~/thesis/octnet/distro/install/share/lua/5.1/cunn/init.lua'
no file './cunn.lua'
no file '~/thesis/octnet/distro/install/share/luajit-2.1.0-beta1/cunn.lua'
no file '/usr/local/share/lua/5.1/cunn.lua'
no file '/usr/local/share/lua/5.1/cunn/init.lua'
no file '/cis/home/msid/.luarocks/lib/lua/5.1/cunn.so'
no file '/cis/home/msid/thesis/octnet/distro/install/lib/lua/5.1/cunn.so'
no file '/cis/home/msid/thesis/octnet/distro/install/lib/cunn.so'
no file './cunn.so'
no file '/usr/local/lib/lua/5.1/cunn.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
...hesis/octnet/distro/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
train_mn10_r64.lua:5: in main chunk
[C]: in function 'dofile'
...net/distro/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00406670
I don't know LUA but from what I understand, this error is coming either when it's loading a gpu model on a cpu machine or from the require('cunn') statement. I also see some :add( cudnn.xxxx) statements which require gpu version ? I guess my request is, can you make a cpu-only version of this code and a gpu version ? Thanks in advance !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.