tsunghan-wu / RandLA-Net-pytorch

:four_leaf_clover: Pytorch Implementation of RandLA-Net (https://arxiv.org/abs/1911.11236)
MIT License
122 stars 33 forks source link

TypeError: confusion_matrix() takes 2 positional arguments but 3 were given #22

Open 1806610292 opened 1 year ago

1806610292 commented 1 year ago

when I run python train_SemanticKITTI.py , an error happen: 100%|███████████████████████████████████████| 4541/4541 [04:12<00:00, 17.99it/s] 100%|█████████████████████████████████████████| 909/909 [18:11<00:00, 1.20s/it] 0%| | 0/136 [00:08<?, ?it/s] Traceback (most recent call last): File "train_SemanticKITTI.py", line 197, in main() File "train_SemanticKITTI.py", line 193, in main trainer.train() File "train_SemanticKITTI.py", line 138, in train mean_iou = self.validate() File "train_SemanticKITTI.py", line 167, in validate iou_calc.add_data(end_points) File "/home/tukrin/ZYD_3D/RandLA-Net-pytorch-main/utils/metric.py", line 29, in add_data conf_matrix = confusion_matrix(labels_valid, pred_valid, np.arange(0, self.cfg.num_classes, 1)) TypeError: confusion_matrix() takes 2 positional arguments but 3 were given

I don"t know how to solve this problem,can you help me? thanks!!!

huixiancheng commented 1 year ago

It's caused by the version of sklearn. See this to slove.

conf_matrix = confusion_matrix(labels_valid, pred_valid, labels=np.arange(0, self.cfg.num_classes, 1))
1806610292 commented 1 year ago

@huixiancheng thanks,has solved!