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

train过程中w和h变得很大 #40

Open
volcano1995 opened this issue Oct 1, 2019 · 0 comments
Open

train过程中w和h变得很大 #40

volcano1995 opened this issue Oct 1, 2019 · 0 comments

Comments

@volcano1995
Copy link

训练过程中出现了下图这样的问题:
[Epoch 0/2000, Batch 114/117264] [Losses: x 0.567772, y 0.612249, w 25922512289561715933184.000000, h 142289888154081864712192.000000, conf 45.791771, cls 12.687886, total 168212400443643580645376.000000, recall: 0.00000, precision: 0.00000]

同时报错如下:
Traceback (most recent call last):
File "sparsity_train.py", line 154, in
train()
File "sparsity_train.py", line 100, in train
loss = model(imgs, targets)
File "/home/volcano/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/volcano/expand/yolov3-network-slimming/yolomodel.py", line 353, in forward
x, *losses = self.module_list[i][0](x, targets)
File "/home/volcano/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/volcano/expand/yolov3-network-slimming/yolomodel.py", line 134, in forward
loss_conf = self.bce_loss(pred_conf[conf_mask_false], tconf[conf_mask_false]) +
File "/home/volcano/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/volcano/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 498, in forward
return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction)
File "/home/volcano/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py", line 2051, in binary_cross_entropy
input, target, weight, reduction_enum)
RuntimeError: Assertion `x >= 0. && x <= 1.' failed. input value should be between 0~1, but got nan at /opt/conda/conda-bld/pytorch_1565272271120/work/aten/src/THNN/generic/BCECriterion.c:62

有人知道如何解决吗?感谢!

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

1 participant