longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.54k stars 421 forks source link

network output 0 and inf #53

Closed ghost closed 6 years ago

ghost commented 6 years ago

i implemented your code with tensorflow (using pretrained vgg instead of darknet), after training with 100 epochs with VOC2007 (cls_loss use MSE, softmax), its output are all zeros or inf, what problems happened? thanks!

ghost commented 6 years ago

i think i missed _boxes[:, :, 0:2] = 0.5 _boxes[:, :, 2:4] = 1.0 _box_mask = np.zeros([hw, num_anchors, 1], dtype=np.float) + 0.01

for training, is it important?

with/without it, my network still failed, i dont how to make it work :(

ghost commented 6 years ago

i forgot warmup epọchs, it works but cost lots of time to train pascal/voc