loicland / superpoint_graph

Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs
MIT License
760 stars 214 forks source link

computation has overflowed #253

Closed sandeepnmenon closed 1 year ago

sandeepnmenon commented 3 years ago

While trying to run the graph_processing code on my custom dataset. On some point clouds, I get the following error.

Traceback (most recent call last):
  File "supervized_partition/graph_processing.py", line 656, in <module>
    main()
  File "supervized_partition/graph_processing.py", line 203, in main
    graph_nn, local_neighbors = compute_graph_nn_2(xyz, args.k_nn_adj, args.k_nn_local, voronoi = args.use_voronoi)
  File "/home/SandeepMenon/superpoint/superpoint_graph/supervized_partition/../partition/graphs.py", line 43, in compute_graph_nn_2
    tri = Delaunay(xyz)
  File "qhull.pyx", line 1840, in scipy.spatial.qhull.Delaunay.__init__
  File "qhull.pyx", line 356, in scipy.spatial.qhull._Qhull.__init__
scipy.spatial.qhull.QhullError: QH6154 Qhull precision error: Initial simplex is flat (facet 3 is coplanar with the interior point)

While executing:  | qhull d Qt Qc Q12 Qz Qbb
Options selected for Qhull 2019.1.r 2019/06/21:
  run-id 1659532516  delaunay  Qtriangulate  Qcoplanar-keep  Q12-allow-wide
  Qz-infinity-point  Qbbound-last  _pre-merge  _zero-centrum  Qinterior-keep
  Pgood  _max-width 4.4e+19  Error-roundoff 9e+04  _one-merge 8.1e+05
  Visible-distance 5.4e+05  U-max-coplanar 5.4e+05  Width-outside 1.1e+06
  _wide-facet 3.2e+06  _maxoutside 1.1e+06

The input to qhull appears to be less than 4 dimensional, or a
computation has overflowed.

Qhull could not construct a clearly convex simplex from points:
- p72656(v5):  -7.6    34 6.1e+14 4.4e+19
- p16193(v4):   -14    42 4.4e+19 4e+19
- p6655(v3): -1.5e+02   -76    14 6e-16
- p31551(v2): 2e+02    29  0.15 8.3e-16
- p9864(v1): -2e+02    26   3.9 8.2e-16

The center point is coplanar with a facet, or a vertex is coplanar
with a neighboring facet.  The maximum round off error for
computing distances is 9e+04.  The center point, facets and distances
to the center point are as follows:

center point   -35.31    10.95 8.889e+18 1.697e+19

facet p16193 p6655 p31551 p9864 distance= -6.6e+18
facet p72656 p6655 p31551 p9864 distance= -8.8e+18
facet p72656 p16193 p31551 p9864 distance=  -21
facet p72656 p16193 p6655 p9864 distance=  -73
facet p72656 p16193 p6655 p31551 distance=  -22

These points either have a maximum or minimum x-coordinate, or
they maximize the determinant for k coordinates.  Trial points
are first selected from points that maximize a coordinate.

The min and max coordinates for each dimension are:
  0:    -200.1     200.1  difference= 400.3
  1:     -76.4      76.4  difference= 152.8
  2:     -1.32  4.444e+19  difference= 4.444e+19
  3:         0  4.444e+19  difference= 4.444e+19

If the input should be full dimensional, you have several options that
may determine an initial simplex:
  - use 'QJ'  to joggle the input and make it full dimensional
  - use 'QbB' to scale the points to the unit cube
  - use 'QR0' to randomly rotate the input for different maximum points
  - use 'Qs'  to search all points for the initial simplex
  - use 'En'  to specify a maximum roundoff error less than 9e+04.
  - trace execution with 'T3' to see the determinant for each point.

If the input is lower dimensional:
  - use 'QJ' to joggle the input and make it full dimensional
  - use 'Qbk:0Bk:0' to delete coordinate k from the input.  You should
    pick the coordinate with the least range.  The hull will have the
    correct topology.
  - determine the flat containing the points, rotate the points
    into a coordinate plane, and delete the other coordinates.
  - add one or more points to make the input full dimensional.

Since it is happening only in some point clouds, the issue cant be with the dimension of the input, but the overflow issue.

loicland commented 1 year ago

Hi!

We are releasing a new version of SuperPoint Graph called SuperPoint Transformer (SPT). It is better in any way:

✨ SPT in numbers ✨
📊 SOTA results: 76.0 mIoU S3DIS 6-Fold, 63.5 mIoU on KITTI-360 Val, 79.6 mIoU on DALES
🦋 212k parameters only!
⚡ Trains on S3DIS in 3h on 1 GPU
Preprocessing is x7 faster than SPG!
🚀 Easy install (no more boost!)

If you are interested in lightweight, high-performance 3D deep learning, you should check it out. In the meantime, we will finally retire SPG and stop maintaining this repo.