Harry-Zhi / semantic_nerf

The implementation of "In-Place Scene Labelling and Understanding with Implicit Scene Representation" [ICCV 2021].
Other
426 stars 56 forks source link

Error when evaluating #1

Closed yzheng97 closed 2 years ago

yzheng97 commented 2 years ago

The error occurs on both Replica and ScanNet datasets.

Traceback (most recent call last): File "train_SSR_main.py", line 224, in train() File "train_SSR_main.py", line 212, in train ssr_trainer.step(global_step) File "/opt/data3/semantic_nerf-main/SSR/training/trainer.py", line 1027, in step number_classes=self.num_valid_semantic_class, ignore_label=self.ignore_label) File "/opt/data3/semantic_nerf-main/SSR/training/training_utils.py", line 67, in calculate_segmentation_metrics conf_mat = confusion_matrix(true_labels, predicted_labels, labels=list(range(number_classes))) File "/home/zy/miniconda3/envs/nerf/lib/python3.7/site-packages/sklearn/utils/validation.py", line 72, in inner_f return f(**kwargs) File "/home/zy/miniconda3/envs/nerf/lib/python3.7/site-packages/sklearn/metrics/_classification.py", line 276, in confusion_matrix y_type, y_true, y_pred = _check_targets(y_true, y_pred) File "/home/zy/miniconda3/envs/nerf/lib/python3.7/site-packages/sklearn/metrics/_classification.py", line 81, in _check_targets check_consistent_length(y_true, y_pred) File "/home/zy/miniconda3/envs/nerf/lib/python3.7/site-packages/sklearn/utils/validation.py", line 256, in check_consistent_length " samples: %r" % [int(l) for l in lengths]) ValueError: Found input variables with inconsistent numbers of samples: [19814400, 11767603]

Harry-Zhi commented 2 years ago

Hi @yzheng97,

Many thanks for your prompt feedbacks!

It turns out that I mistakenly removed a line of code in semantic evaluation. I have made a quick fix and it should work as expected now.

Please let me know if there is any other isses.

yzheng97 commented 2 years ago

Thanks!