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

what is the INPUT_BLOB_NAME and OUTPUT_BLOB_NAME, when trensorrt forward? #8

Open
xinsuinizhuan opened this issue Jul 7, 2022 · 3 comments

Comments

@xinsuinizhuan
Copy link

xinsuinizhuan commented Jul 7, 2022

yolov5 is:
const char* INPUT_BLOB_NAME = "data";
const char* OUTPUT_BLOB_NAME = "prob";

yolov6 is:
const char* INPUT_BLOB_NAME = "image_arrays";
const char* OUTPUT_BLOB_NAME = "outputs";

yolov7 input is images and output is putput
const char* INPUT_BLOB_NAME = "images";
const char* OUTPUT_BLOB_NAME = "output";

yolov7, use the above, all is -1, as below:
IRuntime* runtime = createInferRuntime(gLogger);
assert(runtime != nullptr);
ICudaEngine* engine = runtime->deserializeCudaEngine(trtModelStream, size);
assert(engine != nullptr);
IExecutionContext* context = engine->createExecutionContext();
assert(context != nullptr);
delete[] trtModelStream;
const ICudaEngine& engine = context.getEngine();
const int inputIndex = engine.getBindingIndex(INPUT_BLOB_NAME); //return -1
const int outputIndex = engine.getBindingIndex(OUTPUT_BLOB_NAME); //return -1

@xinsuinizhuan
Copy link
Author

I export the pt to onnx,then convert then onnx to tensorrt model, the use the tensorrt model to forward, all yolov5 and yolov6 is ok, but when yolov7 forward,
const int inputIndex = engine.getBindingIndex(INPUT_BLOB_NAME); //return -1
const int outputIndex = engine.getBindingIndex(OUTPUT_BLOB_NAME); //return -1

@philipp-schmidt
Copy link
Contributor

output_names=['classes', 'boxes'] if y is None else ['output']

Maybe this? Classes and boxes

@xinsuinizhuan
Copy link
Author

I test with classes and boxes, still return -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants