Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy onnx with c++, how to know the predict num #106

Open
XDxiaoqi opened this issue Mar 6, 2023 · 0 comments
Open

deploy onnx with c++, how to know the predict num #106

XDxiaoqi opened this issue Mar 6, 2023 · 0 comments
Labels
question Further information is requested

Comments

@XDxiaoqi
Copy link

XDxiaoqi commented Mar 6, 2023

❔Question

deploy onnx with c++, how to know the predict num, can know with python

Additional context

  1. 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)

  2. 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();

@XDxiaoqi XDxiaoqi added the question Further information is requested label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant