Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run example 00_create_data #3

Closed
siddharthm28 opened this issue Apr 20, 2017 · 2 comments
Closed

Unable to run example 00_create_data #3

siddharthm28 opened this issue Apr 20, 2017 · 2 comments

Comments

@siddharthm28
Copy link

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 !

@siddharthm28
Copy link
Author

Just to complete this example, I commented out the statement that was causing the error and everything worked fine.

  [OctreeCreateCpu] create octree structure
  [OctreeCreateCpu] update octree data structure
  [OctreeCreateCpu] fill data
  [OctreeCreateCpu] done
pc - n_pts: 100, feature_size: 3
  [OctreeFromPC] normalize inplace
create octree
  [OctreeFromPC] determine block pts intersections for grid 8,8,8 - 100 pts
  [OctreeCreateCpu] create octree structure
  [OctreeCreateCpu] update octree data structure
  [OctreeCreateCpu] fill data
  [OctreeCreateCpu] done
pc - n_pts: 100, feature_size: 3
create octree
  [OctreeFromPC] determine block pts intersections for grid 8,8,8 - 100 pts
  [OctreeCreateCpu] create octree structure
  [OctreeCreateCpu] update octree data structure
  [OctreeCreateCpu] fill data
  [OctreeCreateCpu] done

@griegler
Copy link
Owner

There seems to be a problem with some versions of Python/Cython. On my machine dense[np.newaxis,...] produces a contiguous array. However, using Anaconda it gives the error described above. I added a copy to the example to ensure a contiguous array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants