Closed Dreameo closed 1 year ago
I've got the same question. Have you solved it yet?
I've got the same question. Have you solved it yet?
I got a bug when I training
(randlanet) wx@dl-group-workstation:/media/wx/HDD/DQ/RandLA-Net-pytorch-main$ python train_SemanticKITTI.py 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19130/19130 [00:40<00:00, 473.39it/s] 0%| | 0/3826 [00:03<?, ?it/s] Traceback (most recent call last): File "train_SemanticKITTI.py", line 191, in main() File "train_SemanticKITTI.py", line 187, in main trainer.train() File "train_SemanticKITTI.py", line 131, in train self.train_one_epoch() File "train_SemanticKITTI.py", line 120, in train_one_epoch loss, end_points = compute_loss(end_points, self.train_dataset, self.criterion) File "/media/wx/HDD/DQ/RandLA-Net-pytorch-main/network/loss_func.py", line 28, in compute_loss loss = criterion(valid_logits, valid_labels).mean() File "/home/wx/anaconda3/envs/randlanet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/wx/anaconda3/envs/randlanet/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 1152, in forward label_smoothing=self.label_smoothing) File "/home/wx/anaconda3/envs/randlanet/lib/python3.6/site-packages/torch/nn/functional.py", line 2846, in cross_entropy return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) RuntimeError: weight tensor should be defined either for all 19 classes or no classes but got weight tensor of shape: [1, 19]
could you please help me?
I had got the same question,but i had solved it . Modify the "train_SemanticKITTI.py" . `
# Loss Function
class_weights = torch.from_numpy(train_dataset.get_class_weight()).float().cuda().latten()
self.criterion = nn.CrossEntropyLoss(weight=class_weights, reduction='none')`
I've got the same question. Have you solved it yet?
# Loss Function
class_weights = torch.from_numpy(train_dataset.get_class_weight()).float().cuda().latten()
self.criterion = nn.CrossEntropyLoss(weight=class_weights, reduction='none')`
I've got the same question. Have you solved it yet?
# Loss Function
class_weights = torch.from_numpy(train_dataset.get_class_weight()).float().cuda().latten()
self.criterion = nn.CrossEntropyLoss(weight=class_weights, reduction='none')`
I got a bug when I training
/home/b6/anaconda3/bin/python /home/b6/ww/KITTI(semantic)/KITTI(semantic)/L5 RandLA-Net-pytorch-main/L5 RandLA-Net-pytorch-main/RandLA-Net-pytorch-main/train_SemanticKITTI.py
100%|██████████| 19130/19130 [00:28<00:00, 665.05it/s]
0%| | 0/3826 [00:01<?, ?it/s]
Traceback (most recent call last):
File "/home/b6/ww/KITTI(semantic)/KITTI(semantic)/L5 RandLA-Net-pytorch-main/L5 RandLA-Net-pytorch-main/RandLA-Net-pytorch-main/train_SemanticKITTI.py", line 191, in
I got a bug when I training
/home/b6/anaconda3/bin/python /home/b6/ww/KITTI(semantic)/KITTI(semantic)/L5 RandLA-Net-pytorch-main/L5 RandLA-Net-pytorch-main/RandLA-Net-pytorch-main/train_SemanticKITTI.py
100%|██████████| 19130/19130 [00:29<00:00, 646.68it/s]
1%| | 45/3826 [02:51<4:00:25, 3.82s/it]
Traceback (most recent call last):
File "/home/b6/ww/KITTI(semantic)/KITTI(semantic)/L5 RandLA-Net-pytorch-main/L5 RandLA-Net-pytorch-main/RandLA-Net-pytorch-main/train_SemanticKITTI.py", line 191, in
Process finished with exit code 1 could you please help me?
I've got the same question. Have you solved it yet?
# Loss Function class_weights = torch.from_numpy(train_dataset.get_class_weight()).float().cuda().latten() self.criterion = nn.CrossEntropyLoss(weight=class_weights, reduction='none')`
do you mean flatten()
?
I got a bug when I training
(randlanet) wx@dl-group-workstation:/media/wx/HDD/DQ/RandLA-Net-pytorch-main$ python train_SemanticKITTI.py 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19130/19130 [00:40<00:00, 473.39it/s] 0%| | 0/3826 [00:03<?, ?it/s] Traceback (most recent call last): File "train_SemanticKITTI.py", line 191, in
main()
File "train_SemanticKITTI.py", line 187, in main
trainer.train()
File "train_SemanticKITTI.py", line 131, in train
self.train_one_epoch()
File "train_SemanticKITTI.py", line 120, in train_one_epoch
loss, end_points = compute_loss(end_points, self.train_dataset, self.criterion)
File "/media/wx/HDD/DQ/RandLA-Net-pytorch-main/network/loss_func.py", line 28, in compute_loss
loss = criterion(valid_logits, valid_labels).mean()
File "/home/wx/anaconda3/envs/randlanet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/wx/anaconda3/envs/randlanet/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 1152, in forward
label_smoothing=self.label_smoothing)
File "/home/wx/anaconda3/envs/randlanet/lib/python3.6/site-packages/torch/nn/functional.py", line 2846, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
RuntimeError: weight tensor should be defined either for all 19 classes or no classes but got weight tensor of shape: [1, 19]
could you please help me?