RandLA-Net-pytorch icon indicating copy to clipboard operation
RandLA-Net-pytorch copied to clipboard

problem about train

Open Dreameo opened this issue 3 years ago • 0 comments

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?

Dreameo avatar Sep 13 '22 10:09 Dreameo