Issue with TensorRT inference run
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
void FeatureExtraction::doInference_run(float* inputBuffer, float* outputBuffer) {
cudaMemcpyAsync(buffers[inputIndex], inputBuffer, inputStreamSize * sizeof(float), cudaMemcpyHostToDevice, cudaStream);
// Ensure that tensor addresses are set
const char* inputTensorName = engine->getIOTensorName(inputIndex);
const char* outputTensorName = engine->getIOTensorName(outputIndex);
// Set tensor addresses
context->setTensorAddress(inputTensorName, buffers[inputIndex]);
context->setTensorAddress(outputTensorName, buffers[outputIndex]);
// Enqueue the inference
if (!context->enqueueV3(cudaStream)) {
std::cerr << "Error: Inference run failed!" << std::endl;
return;
}
cudaMemcpyAsync(outputBuffer, buffers[outputIndex], outputStreamSize * sizeof(float), cudaMemcpyDeviceToHost, cudaStream);
cudaStreamSynchronize(cudaStream);
}
in this code after preprocessing the buffer data given to cuda for further action, But output Buffer has '0' data . What is the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FeatureExtraction::doInference_run and trace the input and output buffers through cudaMemcpyAsync, tensor address setup, enqueueV3, and cudaStreamSynchronize. Reproduce the inference with the reported code and determine why outputBuffer remains zero; done means the failure is identified and a verified nonzero or otherwise correct output is obtained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100