client icon indicating copy to clipboard operation
client copied to clipboard

Unexpected Behavior: ModelInferRequest Fields Overwritten with Incorrect Values in Triton C++ Client

Open fighterhit opened this issue 1 year ago • 0 comments

I use the tritonserver:22.12-py3-sdk NGC image and test it with the following code under /workspace/install, but the output seems like the fields are all overwritten by the last set value. Why is this happening?

  • $client_inc=/workspace/install/include
  • $client_lib=/workspace/install/lib
g++ triton_test.cpp -o triton_test -I$client_inc -L$client_lib -lgrpcclient -lprotobuf
  • triton_test.cpp
#include "grpc_client.h"

int main() {
    inference::ModelInferRequest infer_request_;

    infer_request_.set_model_name("pm");
    infer_request_.set_model_version("");
    infer_request_.set_id("2336");

    std::cout << "model name: [" << infer_request_.model_name() << "]" << std::endl;
    std::cout << "model version: [" << infer_request_.model_version() << "]" << std::endl;
    std::cout << "id: [" << infer_request_.id() << "]" << std::endl;
    return 0;
}
#output:
model name: [2336]
model version: [2336]
id: [2336]

fighterhit avatar Sep 05 '24 02:09 fighterhit