Skip to content

Commit 6b971f6

Browse files
committed
Raise an exception if no input is provided
1 parent cac1cb4 commit 6b971f6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/algorithms/machinelearning/onnxpredict.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ void OnnxPredict::configure() {
8686

8787
// use the first input when no input is defined
8888
if (_nInputs == 0){
89-
// take the first input
90-
_inputs.push_back(_session.GetInputNames()[0]);
91-
_nInputs = _inputs.size();
92-
// inform the first model input will be used
93-
E_INFO("OnnxPredict: using the first model input '" + _inputs[0] + "'");
89+
throw EssentiaException("No model input was defined.\n" + availableInputInfo());
9490
}
9591

9692
// define _outputs with the first model output when no output is provided

0 commit comments

Comments
 (0)