You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dist: Pop OS 22.04
I have encountered error in l1_loss.py while training SMOKE.
pred.size(): torch.Size([0, 2])
target.size(): torch.Size([0, 2])
target.numel(): 0
Traceback (most recent call last):
File "/home/einhart/MonoDetector/tools/train.py", line 63, in <module>
main()
File "/home/einhart/MonoDetector/tools/train.py", line 58, in main
engine.train()
File "/home/einhart/MonoDetector/tools/../engine/base_engine.py", line 115, in train
avg_loss, elapsed_time = self.train_one_epoch()
File "/home/einhart/MonoDetector/tools/../utils/decorators.py", line 7, in wrapper
result = function(*args, **kwargs)
File "/home/einhart/MonoDetector/tools/../engine/mono_engine.py", line 85, in train_one_epoch
_, loss_dict = self.model(data_dict)
File "/home/einhart/anaconda3/envs/MonoDetector/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/einhart/anaconda3/envs/MonoDetector/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/einhart/MonoDetector/tools/../model/detector/base_mono_detector.py", line 66, in forward
pred_dict, loss_dict = self.head.forward_train(feat, data_dict)
File "/home/einhart/MonoDetector/tools/../model/dense_heads/base_dense_heads.py", line 106, in forward_train
loss_dict = self._get_losses(pred_dict, target_dict)
File "/home/einhart/MonoDetector/tools/../model/dense_heads/smoke_heads.py", line 206, in _get_losses
offset_loss = self.crit_offset(offset_pred, offset_target)
File "/home/einhart/anaconda3/envs/MonoDetector/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/einhart/anaconda3/envs/MonoDetector/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/einhart/MonoDetector/tools/../losses/l1_loss.py", line 43, in forward
return self.loss_weight * l1_loss(pred, target, weight, reduction=reduction, avg_factor=avg_factor)
File "/home/einhart/MonoDetector/tools/../losses/utils.py", line 46, in wrapper
loss = loss_func(pred, target, **kwargs)
File "/home/einhart/MonoDetector/tools/../losses/l1_loss.py", line 19, in l1_loss
assert pred.size() == target.size() and target.numel() > 0
AssertionError
I have added few lines in l1_loss to print pred.size(), target.size() and target.numel():
if pred.size() != target.size() or target.numel() <= 0:
print('pred.size():',pred.size())
print('target.size():',target.size())
print('target.numel():',target.numel())
Do you have any idea how could I fix this problem?
The text was updated successfully, but these errors were encountered:
Einhartd
changed the title
L1_loss error while training model
L1_loss error while training SMOKE model (kitti dataset)
Dec 4, 2023
Dist: Pop OS 22.04
I have encountered error in
l1_loss.py
while training SMOKE.I have added few lines in l1_loss to print pred.size(), target.size() and target.numel():
Do you have any idea how could I fix this problem?
The text was updated successfully, but these errors were encountered: