microsoft / microsoft/onnxruntime-inference-examples
Issue while extracting value from OutputTensor
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 414
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 14
Description
I am trying inference with OnnxRuntime CPP version. Session Run is running fine then getting this error while extracting the output value.
no matching function for call to ‘Ort::Value::GetTensorMutableData()
This is my code snippet for onnx run.
std::vector outputTensor = session.Run(runOptions, input_names.data(), &inputTensor, input_names.size(), output_names.data(), output_names.size());
const float* outputDataPtr = outputTensor[0].GetTensorMutableData();
std::cout << outputDataPtr[0] << std::endl;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is identified; start with the C++ inference example containing the shown Session::Run and GetTensorMutableData calls, then check the ONNX Runtime C++ API signature for Ort::Value. Reproduce the compile error and confirm completion when the example builds and prints the output value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100