microsoft / microsoft/onnxruntime-inference-examples

Issue while extracting value from OutputTensor

Open
#285 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.