Skip to content

During import of a ConcatV2 TensorFlow layer, constant layers are ignored #12931

@coder80

Description

@coder80

System information (version)

  • OpenCV => 4.0.0 - pre ❔
  • Operating System / Platform => Ubuntu 16.04 ❔
  • Compiler => GCC ❔
Detailed description

During import of a ConcatV2 TensorFlow layer, input constant layers are ignored
For example:

lambda_4/Variable is constant layer, but it is not found in the graph

node {
  name: "lambda_4/concatenate_2/concat"
  op: "ConcatV2"
  input: "max_pooling2d_2/MaxPool"
  input: "lambda_4/Variable"
  input: "lambda_4/concatenate_2/concat/axis"
  attr {
    key: "N"
    value {
      i: 2
    }
  }
  attr {
    key: "T"
    value {
      type: DT_FLOAT
    }
  }
  attr {
    key: "Tidx"
    value {
      type: DT_INT32
    }
  }
}
Steps to reproduce

We can see that code (populateNet function in the tf_importer.cpp):

             for (int ii = from; ii < to; ii++)
            {
                Pin inp = parsePin(layer.input(ii));
                if (layer_id.find(inp.name) == layer_id.end())
                    CV_Error(Error::StsError, "Input layer not found: " + inp.name);
                connect(layer_id, dstNet, inp, id, ii - from);
            }

We are looking for it in the layer_id only, but all const layers place in the value_id.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions