tsunghan-wu / RandLA-Net-pytorch

:four_leaf_clover: Pytorch Implementation of RandLA-Net (https://arxiv.org/abs/1911.11236)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

1806610292 opened this issue · comments

commented

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!!!

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))
commented

@huixiancheng thanks,has solved!