(3.4) dnn: support outputs registration under new names#21540
(3.4) dnn: support outputs registration under new names#21540opencv-pushbot merged 2 commits intoopencv:3.4from
Conversation
- fixed ONNX importer
- ONNX output is 1 tensor per defined output instead of N tensors from outputs of "output" layer
|
👍 |
|
|
||
| int registerOutput(const std::string& outputName, int layerId, int outputPort) | ||
| { | ||
| int checkLayerId = getLayerId(outputName); |
There was a problem hiding this comment.
GetLayerId operates on names of layer
It is correct.
instead of names of outputs of layers
I believe output names should not be used during the network construction (it uses internal "nodes" names).
Also output could not be replaced by layer (layers may have multiple output ports)
registerOutput function tries to create dummy "Identity" layer with "required name" (in the end of network construction).
checkLayerId is just a check to avoid duplicates, replacement and inconsistent state of network (dnn still doesn't support "outputs" properly and rely on "unconnected layers" - we need new API for that).
Did you observe error with message: "Layer with name='%s' already exists id=%d (to be linked with %d:%d)"?
There was a problem hiding this comment.
Yes, I did. It happened because the net contains layer with name X, followed by a layer with output named X, hence the error: we mix up layer name with layer 's output name.
continues #21490
TODO: