WongKinYiu / PyTorch_YOLOv4

PyTorch implementation of YOLOv4
1.87k stars 585 forks source link

Reproducing repository results #174

Open zixeljupo opened 3 years ago

zixeljupo commented 3 years ago

Dear Wong!

I was trying to reproduce some results from your repository from scratch, but I failed with this :(

Can you give the cue what might have gone wrong?

Here is the detailed algorithm: 1) Downloaded repository, checkouted to u5 branch; 2) Used data/get_coco2017.sh to download coco2017 dataset, placed it as was required, near the project folder; 3) Created an empty conda environment with python 3.7, installed all requirements from the requirements.txt file, and installed mish_cuda from sources; 4) Launched train script in the following manner:

python train.py --data coco.yaml --cfg yolov4m-mish.yaml --weights '' --batch-size 8

5) It produces the following charts: image 6) When running test.sh with the following parameters:

--img 672
--conf 0.001
--batch 16
--device 0
--data data/coco.yaml
--weights runs/exp1/weights/last.pt

I am getting Average Precision (AP) @ [IoU=0.50:0.95] = 0.403. This is 4.7% points below YOLOv4m-mish model introduced in README.md. I also tried to train yolov4-pacsp-s-mish model on master branch (still in training progress), but this will end below stated result as well, according to current charts.

Waiting for your reply, thanks in advance!

WongKinYiu commented 3 years ago

Could you examine the results with best.pt?

zixeljupo commented 3 years ago

Could you examine the results with best.pt?

Oh, I inspected the checkpoint before sending it, and found, that it's config is of small model (mish-s model), so it was my mistake.

I'm still attaching best.pt file, maybe it will help someone later.

zixeljupo commented 3 years ago

Another small addition: do you still have your tensorboard files for yolov4-pacsp-s-mish model? If so, could you share them?

WongKinYiu commented 3 years ago

u3: image

u5: image

zixeljupo commented 3 years ago

u3: image

u5: image

Thank you very much!

I tried to use master branch as it parses config files directly from the darknet repository (I started training small mish model on master). The charts for are not looking promising now. The main difference between your and my plots is the train objectness metric. I have no final charts of the training, but I'll show my tensorboard results here. image image Blue plot is one that I showed above (small mish model from u5 branch), and the grey one is a small mish model from master branch. It can be seen, that blue chart looks pretty much like your image logs, while grey one is significantly worse, and from the start we can see that it's train objectness is noticeably higher.

Also, I zipped the experiment directory, maybe, this will help to track the issue.