AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.67k stars 7.96k forks source link

darknet.py get different results with the same test image on command line #2267

Open Digital2Slave opened 5 years ago

Digital2Slave commented 5 years ago

I trained an objects detect model based on resnet50 in Ubuntu 16.04 LTS by refer 432 . But, when i test the model with darknet.py on command line. I got different results with the same *.cfg, *.weights, *.data and test image.

For example: By use python darknet.py with the *.cfg, *.weights, *.data and test image. I got the result label 5. But, by use python darknet.py with the same *.cfg, *.weights, *.data and test image many times, I finally got the result label 1.

This is weird. All the command lines run in normal user. I don't know why, anyone could help me out? Thanks a lot. @AlexeyAB

AlexeyAB commented 5 years ago

@JohnTian Hi,

Digital2Slave commented 5 years ago

@AlexeyAB Thanks for your reply.

➜  epbox_tiny_mobile git:(master) python tf_models/pddvsm/pddvsm.py \  
tf_models/pddvsm/pddvsm_resnet50_yolo_recall.cfg \
tf_models/pddvsm/pddvsm_resnet50_yolo_final.weights \   
tf_models/pddvsm/pddvsm.data \  
/mnt/images/epbox/92902000094/2019-01-18/M9290200009490118020/M9290200009490118020_0_crop.jpg  
5  
➜  epbox_tiny_mobile git:(master) python tf_models/pddvsm/pddvsm.py \  
tf_models/pddvsm/pddvsm_resnet50_yolo_recall.cfg \
tf_models/pddvsm/pddvsm_resnet50_yolo_final.weights \   
tf_models/pddvsm/pddvsm.data \  
/mnt/images/epbox/92902000094/2019-01-18/M9290200009490118020/M9290200009490118020_0_crop.jpg  
1  

Finally, after retrain the model by adding new labelled images. This weird phenomena disappeared! By now, for the same test image, this model always produce '5'.

➜  epbox_tiny_mobile git:(master) python tf_models/pddvsm/pddvsm.py \  
tf_models/pddvsm/pddvsm_resnet50_yolo_recall.cfg \
tf_models/pddvsm/pddvsm_resnet50_yolo_final.weights \   
tf_models/pddvsm/pddvsm.data \  
/mnt/images/epbox/92902000094/2019-01-18/M9290200009490118020/M9290200009490118020_0_crop.jpg   
5  
OndoyManing commented 5 years ago

@JohnTian Hello! Would it be possible for you to share your darknet.py? I just want to test it out because the one included in the zip file does not work for me.

Digital2Slave commented 5 years ago

@OndoyManing darknet.py Be sure, your darknet.so is generated correct.

benjaminabruzzo commented 5 years ago

I had a similar issue, though I posted it on the pjreddie page: https://github.com/pjreddie/darknet/issues/1547