scannetpp / scannetpp

118 stars 6 forks source link

Zero-size array error during 2D rasterization of semantics #87

Open tberriel opened 1 month ago

tberriel commented 1 month ago

Hi,

First of all, thanks for publishing the 2D rasterization of semantic labels!

Unfortunately when launching
python -m semantic.prep.rasterize_semantics_2d semantic/configs/rasterize_semantics_2d.yml

I'm getting the error ValueError: zero-size array to reduction operation minimum which has no identity

with traceback to line 205 of _semantic/prep/rasterize_semantics2d.py bbox_min = np.min(nonzero_inds, axis=1)

Prior to running _rasterize_semantics2d.py, to generate the PTH files I launched python -m semantic.prep.prepare_training_data semantic/configs/prepare_training_data.yml

removing the sample transform to keep the _vtx__* keys called in _rasterize_semantics2d.py .

My config files are:

* rasterize_semantics_2d.yml:
data_root: <base_path>/data
pth_data_dir: <base_path>/semantic_data
scene_list: <base_path>/scannetpp_scenes.txt
semantic_labels_path: <base_path>/metadata/semantic_classes.txt
dslr_subsample_factor: 1
viz: false

Also, to run _rasterize_semantics_2d.py_ I had to install pytorch3D and its dependencies which currently are not included in requirements.txt . Following the [docs](https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md), I run
conda activate scannetpp
conda install pytorch=1.13.0 torchvision pytorch-cuda=11.6 -c pytorch -c nvidia
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
conda install pytorch3d -c pytorch3d    


Finally, I had to remove `scannetpp.` from lines 23 and 24 of rasterize_semantics_2d.py to make the import consistent with the rest of the files from the respository.

I hope you can reproduce my error, thanks for you help!

Tomás
cy94 commented 3 weeks ago

Hi, thanks for your input. The code is not very polished unfortunately, we'll try to improve it. Could you find out which scene and object ID gives the error? You can try ignoring that instance and see if that fixes it.

HUQiancheng commented 1 week ago

What I found was at : 56a0ec536c, which is the first one on nvs_sem_train.txt. I am currently working on it and try to mark these ids as much as possible.