-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
dnn: darknet importer has no "relu" activation #17778
Copy link
Copy link
Closed
Milestone
Description
System information (version)
- OpenCV => 4.3.0-dev
- Operating System / Platform => Windows7 32 Bit
- Compiler => mingw64(8.1)
Detailed description
while checking out a ultra small(500k !) yolov3 model from here i got a :
cv2.error: OpenCV(4.3.0-dev) C:\p\opencv\modules\dnn\src\darknet\darknet_io.cpp:831: error: (-212:Parsing error) Unsupported activation: relu in function 'ReadDarknetFromCfgStream'
it has a couple of activation=relu lines, e.g. here but in darknet_io.cpp there is only a leaky activation:
opencv/modules/dnn/src/darknet/darknet_io.cpp
Lines 865 to 868 in 524a2ff
| if (activation == "leaky") | |
| { | |
| setParams.setActivation("relu"); | |
| } |
calling this:
opencv/modules/dnn/src/darknet/darknet_io.cpp
Lines 223 to 227 in 524a2ff
| if (type == "relu") | |
| { | |
| activation_param.set<float>("negative_slope", 0.1f); | |
| activation_param.type = "ReLU"; | |
| } |
so, this is indeed the "leaky" variant (used in all other yolo models), and real "relu" would have a slope of 0.0, right ?
Steps to reproduce
net = cv.dnn.readNet('yoloface-500k.cfg', 'yoloface-500k.weights')
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc
Reactions are currently unavailable