philipperemy / yolo-9000

YOLO9000: Better, Faster, Stronger - Real-Time Object Detection. 9000 classes!
Apache License 2.0
1.18k stars 309 forks source link

Prediction results on CPU and GPU are different on the same image #39

Closed fengsky401 closed 4 years ago

fengsky401 commented 5 years ago

system:ubuntu 16.04 Cuda-10,cudnn-7 When I compile on gpu, executed ./darknet detector test cfg/combine9k.data cfg/yolo9000.cfg ../yolo9000-weights/yolo9000.weights data/horses.jpg the result is as below: mask_scale: Using default '1.000000' Loading weights from ../yolo9000-weights/yolo9000.weights...Done! data/horses.jpg: Predicted in 0.057828 seconds. horse: 50% horse: 84% even-toed ungulate: 72%

While when I compile on CPU, executed ./darknet detector test cfg/combine9k.data cfg/yolo9000.cfg ../yolo9000-weights/yolo9000.weights data/horses.jpg the result is as below: mask_scale: Using default '1.000000' Loading weights from ../yolo9000-weights/yolo9000.weights...Done! data/horses.jpg: Predicted in 11.524895 seconds. wild horse: 50% Shetland pony: 84% Aberdeen Angus: 72%

I don't know what is the resaon?

Kolinko-Danylo commented 4 years ago

Same issue while compiling in colab. CPU predictions are much more detailed than ones obtained by GPU. Source photo: http://www.urbanstreetdiving.com/wp-content/uploads/2018/02/Urban-Street-Diving-Street-Photography-Kerem-Nasipoglu-Istanbul-02.jpg

CPU: minivan: 68% limousine: 68% Staffordshire bullterrier: 47% bicycle-built-for-two: 71%

GPU: car: 68% car: 68% dog: 48% artifact: 71%

philipperemy commented 4 years ago

Yes I've seen that too. It comes from darknet. It seems that the computations are slightly different whether it's compiled on CPU or GPU. It's a known thing and it should be addressed directly here. I've opened an issue on the related project.

Related issues: https://github.com/pjreddie/darknet/issues/784 Project: https://github.com/pjreddie/darknet

philipperemy commented 4 years ago

Issue available here: https://github.com/pjreddie/darknet/issues/1865