Merge pull request #17849 from dkurt:fix_17848

pull/17865/head
Alexander Alekhin 4 years ago
commit bf8136eaa6
  1. 3
      modules/dnn/src/graph_simplifier.cpp
  2. 5
      modules/dnn/src/tensorflow/tf_graph_simplifier.cpp

@ -63,9 +63,6 @@ int Subgraph::getInputNodeId(const Ptr<ImportGraphWrapper>& net,
{
CV_Assert(inpId < node->getNumInputs());
std::string name = node->getInputName(inpId);
// If operation produces several tensors, they are specified by index
// after ':' character. In example, "input:0".
name = name.substr(0, name.rfind(':'));
const int numNodes = net->getNumNodes();
for (int i = 0; i < numNodes; ++i)
{

@ -31,7 +31,10 @@ public:
virtual std::string getInputName(int idx) const CV_OVERRIDE
{
return node->input(idx);
// If operation produces several tensors, they are specified by index
// after ':' character. In example, "input:0".
std::string name = node->input(idx);
return name.substr(0, name.rfind(':'));
}
virtual std::string getType() const CV_OVERRIDE

Loading…
Cancel
Save