训练过程中出现了下图这样的问题:
[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
训练过程中出现了下图这样的问题: [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
有人知道如何解决吗?感谢!