We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: weight tensor should be defined either for all 19 classes or no classes but got weight tensor of shape: [1, 19] how to solve
The text was updated successfully, but these errors were encountered:
I have same error,have u solve it?
Sorry, something went wrong.
weight‘s shape should be (19,),not (1,19) in train_SemantciKITTI.py,line 94
class_weights = torch.from_numpy(train_dataset.get_class_weight()).float().cuda() class_weights=class_weights.squeeze(0) self.criterion = nn.CrossEntropyLoss(weight=class_weights, reduction='none')
weight‘s shape should be (19,),not (1,19) in train_SemantciKITTI.py,line 94 class_weights = torch.from_numpy(train_dataset.get_class_weight()).float().cuda() class_weights=class_weights.squeeze(0) self.criterion = nn.CrossEntropyLoss(weight=class_weights, reduction='none')
class_weights = torch.from_numpy(train_dataset.get_class_weight()).float().view(19).cuda() # change code to this can run
No branches or pull requests
RuntimeError: weight tensor should be defined either for all 19 classes or no classes but got weight tensor of shape: [1, 19]
how to solve
The text was updated successfully, but these errors were encountered: