gaussian-splatting icon indicating copy to clipboard operation
gaussian-splatting copied to clipboard

Using custom number of points

Open samiragarwala opened this issue 2 years ago • 12 comments
trafficstars

Hi! I was trying to initialise a custom number of points in the blender dataset reader but found runtime issues on doing the same. In particular, I am seeing issues such as RuntimeError: Function _RasterizeGaussiansBackward returned an invalid gradient at index 2 - got [0, 0, 3] but expected shape compatible with [0, 16, 3] when using more than 1 point and RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 1 but got size 15 for tensor number 1 in the list. when using a single point during initialisation. I would appreciate any insight about these issues. Thank you!

samiragarwala avatar Nov 18 '23 20:11 samiragarwala

+1, I met the same problem. 我怀疑可能是坐标系的问题

Gragonfly avatar Nov 20 '23 09:11 Gragonfly

@Gragonfly @samiragarwala Have you solved the problem? I met the same problem...

zhengrongz avatar Dec 19 '23 08:12 zhengrongz

I also meet the same issues, but on Colmap dataset. RuntimeError: Function _RasterizeGaussiansBackward returned an invalid gradient at index 2 - got [0, 0, 3] but expected shape compatible with [0, 16, 3]

However, if i increase the number of points like from 100 to 1000, this issus wont happened. So, I guess it was the problem during optimization? I also looking at it.

ys31jp avatar Dec 22 '23 07:12 ys31jp

could you tell me how to increase "the number of points" ? thanks! @ys31jp

bluemoonwencong avatar Dec 28 '23 12:12 bluemoonwencong

I face the same problem, by checking the code, I think the main reason leading to this problem is the "pruning". Sometimes, all Gaussians are pruned so that the number of gaussian is 0, and then, it may lead to this gradient computation error. Hope this suggestion could help you.

Huster-YZY avatar Jan 26 '24 02:01 Huster-YZY

I try to create a Colmap dataset with a single orthogonal camera. It is traced to the setting of the threshold for pruning large Gaussian kernels. If there is only one camera, the prune extent is 0 pruning everything.

Fengyee avatar Mar 10 '24 23:03 Fengyee

I have the same problem and the error throws alsways at the same Iteration (3100). It is happening with different colmap datasets. So far I tried datasets with roughly 7000 and 31000 initial points. When I set --sh_degree 0 the training completes, but I am left with 0 splats.

tomtom7899 avatar Apr 09 '24 08:04 tomtom7899

I have the same problem and the error throws alsways at the same Iteration (3100). It is happening with different colmap datasets. So far I tried datasets with roughly 7000 and 31000 initial points. When I set --sh_degree 0 the training completes, but I am left with 0 splats.

We have the same problem,so do I when iter 3100,have you solved?thank you!

qianyuling-wl avatar Apr 20 '24 16:04 qianyuling-wl

You may have a bad initialization, no points fall in the camera views. @qianyuling-wl

yifanlu0227 avatar May 14 '24 10:05 yifanlu0227

Hi! I might found the solution to this problem:

In getNerfppNorm here, we estimate the radius of the scene using the camera positions, and use it as the camera_extent here.

Then this parameter is used to prune the point here.

As a result, if the camera are located closely with each other, rather than surround the scene, we would get a small "scene radius". Specifically, if we only has one camera position, we would get radius=0, and this would prune all of the points, which result in your error: RuntimeError: Function _RasterizeGaussiansBackward returned an invalid gradient at index 2 - got [0, 0, 3] but expected shape compatible with [0, 16, 3].

To debug, you may manually set the radius in getNerfppNorm to the radius of your scene.

raynehe avatar Jul 08 '24 11:07 raynehe

Hi! I might found the solution to this problem:

In getNerfppNorm here, we estimate the radius of the scene using the camera positions, and use it as the camera_extent here.

Then this parameter is used to prune the point here.

As a result, if the camera are located closely with each other, rather than surround the scene, we would get a small "scene radius". Specifically, if we only has one camera position, we would get radius=0, and this would prune all of the points, which result in your error: RuntimeError: Function _RasterizeGaussiansBackward returned an invalid gradient at index 2 - got [0, 0, 3] but expected shape compatible with [0, 16, 3].

To debug, you may manually set the radius in getNerfppNorm to the radius of your scene.

Thanks, I solved it. This is exactly the problem.

yuhaoliu7456 avatar Aug 22 '24 11:08 yuhaoliu7456