Open autm09 opened 3 years ago
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时会出错,但是我不知道该怎么修改 去掉所有负样本后不再报错了 可是负样本不是专门生成用来提升训练效果的吗? 或者这个错误是因为其他的原因? 求解答,谢谢您
multibox_loss hello你好,请问你解决了嘛?
https://github.com/biubug6/Pytorch_Retinaface/pull/128/commits/034f4aa0a2e244e361e7f6b0b3548c8966de3e0f#diff-a615ce76ee3f43281156122196c7656acb790693eb5285ca6b92424d1214e014 这个试过吗
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时会出错,但是我不知道该怎么修改
去掉所有负样本后不再报错了
可是负样本不是专门生成用来提升训练效果的吗?
或者这个错误是因为其他的原因?
求解答,谢谢您