Pytorch-yolov3: No detection after overfitting my own dataset.

Created on 12 Jun 2018  路  4Comments  路  Source: eriklindernoren/PyTorch-YOLOv3

I trained this model for detection of hands. and to first check the model i trained it on 32 images for 60 epochs and this is what i am getting after 60 epochs.
image
but when i ran detect.py on same dataset that i overfitted. there are no bounding boxes
i changed configuration i.e number of classes from 80 to 1, filters from 255 to 18. also the coco.data and coco.names file.
the labels are as follows
[class name, width_center, height_center , width, height]
example [0, 0.4, 0.3 , 0.2 , 0.1]

when i print detections in detect.py. it gives [nan,nan, nan.....]

But no results in output

Most helpful comment

Resolved by changing these 3 lines
From this:
model = Darknet(opt.model_config_path)

model.load_weights(opt.weights_path)

model.apply(weights_init_normal)
To this :
model = Darknet(opt.model_config_path)
model.load_weights(opt.weights_path)

model.apply(weights_init_normal)

All 4 comments

Resolved by changing these 3 lines
From this:
model = Darknet(opt.model_config_path)

model.load_weights(opt.weights_path)

model.apply(weights_init_normal)
To this :
model = Darknet(opt.model_config_path)
model.load_weights(opt.weights_path)

model.apply(weights_init_normal)

@0merjavaid I am facing the same problem.

In #16 I tried to train with my own dataset, but I thought that it was training well. When I tested and detect I realized that any detections were made and mAP 0.

As you commented above I changed de configuration files, I am trying to train with 6 objects so I changed:

  • coco.names: from 80 objects to 6.
  • yolov3.cfg: changing classes 80 to 6 and filters 255 to 33.
  • coco.data: linking to my images in the .txt file and changing the classes as well
  • labels in the same format as commented.

I tried to train with coco dataset, then load the weights of my training and testing & detection worked well.

I don't know why is not working with my own dataset, I debugged the code and in training is predicting well (I printed the value when iou > 0.5), I think maybe is a problem saving the weights?

I would appreciate any insight in that, sorry for reopen the problem but I am stuck with that.

Thank you in advance.

ps: @eriklindernoren I am developing the clustering for adapting the anchors to any dataset, if you think is interesting we can add it to the repo.

@lupotto first of all the weights saving is alright. i used my trained model and it worked fine.
till now i haven't ran testing script. is your problem with the testing or detection as well?
btw you should also try lowering the --conf_thres while testing. if during training it was 0.8 then try 0.5 or 0.6

@0merjavaid my problem is with both (testing & detection), I lowered the conf_thres and had mAP 0 again.

Was this page helpful?
0 / 5 - 0 ratings