IndexError: tensors used as indices must be long, byte or bool tensors
Number of gaussians left: 185091
Opacities min/max/mean: tensor(0.5000, device='cuda:0') tensor(1., device='cuda:0') tensor(0.9852, device='cuda:0')
Quantile 0.0: 0.5000418424606323
Quantile 0.1: 0.989769458770752
Quantile 0.2: 0.9993429780006409
Quantile 0.3: 0.99977046251297
Quantile 0.4: 0.9998769760131836
Quantile 0.5: 0.99992835521698
Quantile 0.6: 0.9999568462371826
Quantile 0.7: 0.9999749660491943
Quantile 0.8: 0.9999866485595703
Quantile 0.9: 0.9999943971633911
Traceback (most recent call last):
File "/data/SuGaR-main/train.py", line 141, in
Hello @kuaiqushangzixiba,
May I ask more details about your error, and the commands you used?
Looking at your error, self.point_idx_per_pixel may be empty (maybe because of a None somewhere), which could produce your IndexError.
Maybe the foreground of your scene is empty, or something like that.
May I ask, what does your scene look like?
@kuaiqushangzixiba
I encountered the same issue. However, in my case, self.point_idx_per_pixel was not empty.
The problem was resolved by changing self.sh_coordinates[self.point_idx_per_pixel] to self.sh_coordinates[self.point_idx_per_pixel.long()].
In sugar_model.py, self._surface_mesh_faces is also used as indices in 4 lines, for instance in:
faces_verts = self._points[self._surface_mesh_faces] # n_faces, 3, n_coords
You should replace these with self._surface_mesh_faces.long().
@Anttwo
Thank you for your excellent work.
The issue may be related to the version of PyTorch being used.
In my case, I'm using PyTorch version 1.13.1+cu117.