nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

A runtime error happens when using "mask_path"

Open wzhgba opened this issue 3 years ago • 0 comments

Error details

nerfstudio\data\pixel_samplers.py:151 in collate_image_dataset_batch_list
│   150 │   │   │   │   all_indices.append(indices)                                                │
│ ❱ 151 │   │   │   │   all_images.append(batch["image"][i][indices[:, 1], indices[:, 2]])         │
IndexError: index 2 is out of bounds for dimension 1 with size 2

To Reproduce Use "mask_path“ in the transform JSON, and then run ns-train with nerfacto method.

Additional context I debugged this part and found the shape of indices returned by the self.sample_method() (line 146) is (H, W). I guess it may be fixed by replacing the mask=batch["mask"][i] into mask=batch["mask"][i:i+1] (line 147) to remain the batch dimension.

wzhgba avatar Jul 28 '23 03:07 wzhgba