AlexeyAB / darknet

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

Open_cv_Parsing issue #5919

Open SaiSandeepKantareddy opened 4 years ago

SaiSandeepKantareddy commented 4 years ago

hi, this is the error I am facing from this line:

net = cv2.dnn.readNet("yolov4_1000.weights", "yolov4.cfg")

OpenCV(4.2.0) /io/opencv/modules/dnn/src/darknet/darknet_io.cpp:686: error: (-212:Parsing error) Unsupported activation: mish in function 'ReadDarknetFromCfgStream'

KyloEntro commented 4 years ago

opencv 4.2.0 and 4.3.0 can not deal with yolov4. Take the latest version on master branch or wait next release version

ramdhan1989 commented 4 years ago

hopefully can release soon

wrs000001 commented 4 years ago

To use YOLOv4 in OpenCV, you can replace "mish" with "leaky" in “yolov4.cfg”. Then train the model. AP value will decrease a little bit, it doesn't affect me much.

ramdhan1989 commented 4 years ago

To use YOLOv4 in OpenCV, you can replace "mish" with "leaky" in “yolov4.cfg”. Then train the model. AP value will decrease a little bit, it doesn't affect me much.

Thank you so much. I trained yolov4 by replacing"mish" with "leaky". For my own dataset, leaky perform better where AP for mish 80.3% and leaky AP 83.26% and It can run in open cv now without any error.