You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Darknet importer: unable to import clasification configuration file darknet19.cfg #16623
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0-dev) /opencv/modules/dnn/src/dnn.cpp:3781: error: (-2:Unspecified error) Requested set input in function 'dump'
@alalek , @dkurt
while parsing, if we set cost as identity layer
[cost]
type=sse
the parameter type is interpreted as layer type. producing error. darknet_io.cpp:762: error: (-212:Parsing error) Unknown layer type: sse in function 'ReadDarknetFromCfgStream'
Because here we are storing layer type with key "type".
Activity
dkurt commentedon Feb 20, 2020
@isra60, try to remove this layer - it's training only.
isra60 commentedon Feb 20, 2020
I remove it but then when I try
where DNN target and backend are CUDA
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0-dev) /opencv/modules/dnn/src/dnn.cpp:3781: error: (-2:Unspecified error) Requested set input in function 'dump'
dkurt commentedon Feb 20, 2020
@isra60, as pointed in the error message, you should set some input before
dumpWe already fixed that for future releases in #16516
isra60 commentedon Feb 20, 2020
but.... I'm using master branch (4.2.0.-dev) this still should be happen???
dkurt commentedon Feb 20, 2020
Cannot reproduce it with weights from https://pjreddie.com/media/files/darknet19.weights and
.cfgfrom issue description (3.4 branch):output
isra60 commentedon Feb 21, 2020
OK, seems working for me too (My repo was not fully updated sorry).
Is there any tutorial of how to process the detections from the net and also how to prepare the input blob??
dkurt commentedon Feb 21, 2020
@isra60,
darknet19is not detection network - it's classification one.Please follow tutorials https://docs.opencv.org/master/d2/d58/tutorial_table_of_content_dnn.html or samples https://github.com/opencv/opencv/tree/master/samples/dnn
dkurt commentedon Feb 21, 2020
Can we close this issue?
alalek commentedon Feb 21, 2020
I believe we can try to improve DarkNet importer to ignore "Cost" training-only layers.
Any thoughts?
ashishkrshrivastava commentedon Feb 22, 2020
@alalek , Maybe either setting
"Identity"layer for"Cost"layer just like"Dropout"or ignoring while parsing would work ?dkurt commentedon Feb 22, 2020
That's good idea
ashishkrshrivastava commentedon Feb 22, 2020
@alalek , @dkurt
while parsing, if we set
costas identity layerthe parameter
typeis interpreted as layer type. producing error.darknet_io.cpp:762: error: (-212:Parsing error) Unknown layer type: sse in function 'ReadDarknetFromCfgStream'Because here we are storing layer type with key "type".
opencv/modules/dnn/src/darknet/darknet_io.cpp
Lines 552 to 559 in 102ef39
And here "type" parameter is getting stored with key "type" itself.
opencv/modules/dnn/src/darknet/darknet_io.cpp
Lines 562 to 575 in 102ef39
So ignoring while parsing until "[" i.e. next layer is seen is better option ? Am I right ?
dkurt commentedon Feb 22, 2020
There are just three entries of "type" so we probably can replace it to something like "layer_type" to not to mix with "type" as layer attribute.
ashishkrshrivastava commentedon Feb 23, 2020
Thanks, got it.