Fix TensorFlow->ONNX imports

This commit is contained in:
Dmitry Kurtaev 2020-07-15 14:36:13 +03:00
parent d41b20b268
commit cc584760d3
2 changed files with 4 additions and 4 deletions

View File

@ -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)
{

View File

@ -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