You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deploy onnx with c++, how to know the predict num, can know with python
Additional context
the python can print the out shape
session = onnxruntime.InferenceSession(model_path, None)
input_name = session.get_inputs()[0].name #"images"
output = session.run(['detections'], {input_name: input}) #out_name:"detections"
print("output shape is: ", output[0].shape) #can know the shape: (4, 57)
the c++ how to know the shape
size_t input_count = 1;
ort_outputs_.clear();
ort_outputs_ = ort_session_->Run(Ort::RunOptions{ nullptr },
input_names_.data(), &input_tensor, input_count,
output_names_.data(), output_names_.size());
LOG(INFO)<<"line infer ort outputs size: "<<ort_outputs_.size();
//score_map is 57 or 572 or or 573?
float *score_map = ort_outputs_[0].GetTensorMutableData();
The text was updated successfully, but these errors were encountered:
❔Question
deploy onnx with c++, how to know the predict num, can know with python
Additional context
the python can print the out shape
session = onnxruntime.InferenceSession(model_path, None)
input_name = session.get_inputs()[0].name #"images"
output = session.run(['detections'], {input_name: input}) #out_name:"detections"
print("output shape is: ", output[0].shape) #can know the shape: (4, 57)
the c++ how to know the shape
size_t input_count = 1;
ort_outputs_.clear();
ort_outputs_ = ort_session_->Run(Ort::RunOptions{ nullptr },
input_names_.data(), &input_tensor, input_count,
output_names_.data(), output_names_.size());
LOG(INFO)<<"line infer ort outputs size: "<<ort_outputs_.size();
//score_map is 57 or 572 or or 573?
float *score_map = ort_outputs_[0].GetTensorMutableData();
The text was updated successfully, but these errors were encountered: