Skip to content
New issue

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

训练时有无车牌数据会报错 #10

Open
autm09 opened this issue Mar 25, 2021 · 2 comments
Open

训练时有无车牌数据会报错 #10

autm09 opened this issue Mar 25, 2021 · 2 comments

Comments

@autm09
Copy link

autm09 commented Mar 25, 2021

Traceback (most recent call last):
File "train.py", line 165, in
train()
File "train.py", line 134, in train
loss_l, loss_c, loss_landm = criterion(out, priors, targets)
File "xxxx/anaconda3/envs/new/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "xxxx/Pytorch_Retina_License_Plate/layers/modules/multibox_loss.py", line 119, in forward
loss_c = F.cross_entropy(conf_p, targets_weighted, reduction='sum')
File "xxxx/anaconda3/envs/new/lib/python3.6/site-packages/torch/nn/functional.py", line 2056, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File "xxxx/anaconda3/envs/new/lib/python3.6/site-packages/torch/nn/functional.py", line 1871, in nll_loss
ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
RuntimeError: invalid argument 2: non-empty vector or matrix expected at /pytorch/aten/src/THCUNN/generic/ClassNLLCriterion.cu:31
您好,我在照着指引尝试训练时遇到了这样的问题
查了一下,好像是因为负样本在计算loss时会出错,但是我不知道该怎么修改
去掉所有负样本后不再报错了
可是负样本不是专门生成用来提升训练效果的吗?
或者这个错误是因为其他的原因?
求解答,谢谢您

@yangh-zzf-itcast
Copy link

multibox_loss
hello你好,请问你解决了嘛?

@zxm97
Copy link

zxm97 commented Oct 21, 2023

multibox_loss
hello你好,请问你解决了嘛?

biubug6/Pytorch_Retinaface@034f4aa#diff-a615ce76ee3f43281156122196c7656acb790693eb5285ca6b92424d1214e014
这个试过吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants