Set up input and output names and perform consistency checks.
73{
74 const auto& inputNames =
m_session->getOrtSession().GetInputNames();
75 const auto& outputNames =
m_session->getOrtSession().GetOutputNames();
76
77
78 if (inputNames.size() != 1) {
79 std::stringstream msg;
80 msg << "Model has multiple inputs: ";
81 for (auto name : inputNames)
82 msg << "\"" << name << "\" ";
83 msg << "- only single-input models are supported.";
84 B2FATAL(msg.str());
85 }
87
89
90
91 if (outputNames.size() == 1) {
93 B2INFO("Output name of the model is "
94 << outputNames[0]
95 << " - will use that despite the configured name being \""
97 }
99 return;
100 }
101
102
103
106 }
107 auto outputFound = std::find(outputNames.begin(), outputNames.end(),
109 if (!outputFound) {
110 std::stringstream msg;
111 msg <<
"No output named \"" <<
m_outputName <<
"\" found. Instead got ";
112 for (auto name : outputNames)
113 msg << "\"" << name << "\" ";
114 msg <<
"- either change your model to contain one named \"" <<
m_outputName
115 << "\" or set `m_outputName` in the specific options to one of the available names.";
116 B2FATAL(msg.str());
117 }
118}
ONNXOptions m_specific_options
ONNX specific options loaded from weightfile.