shyam671 / Mask2Anomaly-Unmasking-Anomalies-in-Road-Scene-Segmentation

[ICCV'23 Oral] Unmasking Anomalies in Road-Scene Segmentation
46 stars 8 forks source link

IndexError: index 255 is out of bounds for axis 0 with size 34 #10

Closed Zhangwt95 closed 4 months ago

Zhangwt95 commented 4 months ago

Dear authors, I run this commend(CUDA_VISIBLE_DEVICES=0 python train_net.py --num-gpus 1 --config-file configs/cityscapes/semantic-segmentation/anomaly_train.yaml), the following issues will occur:

eta: 1 day, 7:55:10 iter: 4999 total_loss: 43.6 loss_ce: 0.873 loss_mask: 1.135 loss_dice: 2.291 loss_ce_0: 1.078 loss_mask_0: 1.183 loss_dice_0: 2.487 loss_ce_1: 0.951 loss_mask_1: 1.184 loss_dice_1: 2.416 loss_ce_2: 0.8681 loss_mask_2: 1.126 loss_dice_2: 2.373 loss_ce_3: 0.8447 loss_mask_3: 1.139 loss_dice_3: 2.31 loss_ce_4: 0.9072 loss_mask_4: 1.116 loss_dice_4: 2.314 loss_ce_5: 0.8622 loss_mask_5: 1.144 loss_dice_5: 2.321 loss_ce_6: 0.9052 loss_mask_6: 1.136 loss_dice_6: 2.297 loss_ce_7: 0.8597 loss_mask_7: 1.153 loss_dice_7: 2.337 loss_ce_8: 0.9218 loss_mask_8: 1.145 loss_dice_8: 2.318 time: 1.3567 last_time: 1.2917 data_time: 0.4710 last_data_time: 0.3988 lr: 9.4987e-05 max_mem: 16472M

Traceback (most recent call last): File "train_net.py", line 321, in launch( File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/launch.py", line 84, in launch main_func(*args) File "train_net.py", line 315, in main return trainer.train() File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/defaults.py", line 486, in train super().train(self.start_iter, self.max_iter) File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/train_loop.py", line 156, in train self.after_step() File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/train_loop.py", line 190, in after_step h.after_step() File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/hooks.py", line 556, in after_step self._do_eval() File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/hooks.py", line 529, in _do_eval results = self._func() File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/defaults.py", line 455, in test_and_save_results self._last_eval_results = self.test(self.cfg, self.model) File "/usr/local/lib/python3.8/dist-packages/detectron2/engine/defaults.py", line 619, in test results_i = inference_on_dataset(model, data_loader, evaluator) File "/usr/local/lib/python3.8/dist-packages/detectron2/evaluation/evaluator.py", line 213, in inference_on_dataset results = evaluator.evaluate() File "/usr/local/lib/python3.8/dist-packages/detectron2/evaluation/cityscapes_evaluation.py", line 186, in evaluate results = cityscapes_eval.evaluateImgLists( File "/dfs/data/cityscapesScripts/cityscapesscripts/evaluation/evalPixelLevelSemanticLabeling.py", line 475, in evaluateImgLists nbPixels += evaluatePair(predictionImgFileName, groundTruthImgFileName, confMatrix, instStats, perImageStats, args) File "/dfs/data/cityscapesScripts/cityscapesscripts/evaluation/evalPixelLevelSemanticLabeling.py", line 599, in evaluatePair confMatrix[gt_id][pred_id] += c IndexError: index 255 is out of bounds for axis 0 with size 34

How can i solve it? Thank you!

Zhangwt95 commented 4 months ago

The issue was caused by changing the number of labels and has been resolved.

ysz-leo commented 1 month ago

The issue was caused by changing the number of labels and has been resolved.该问题是由更改标签数量引起的,现已解决。

Hello, I would like to ask how to solve it?