linghu8812 / tensorrt_inference

708 stars 208 forks source link

Update mmpose.cpp #129

Closed denred0 closed 2 years ago

denred0 commented 2 years ago

I ran into an error on Windows. During execution we call cudaMemcpyAsync(buffers[0], curInput.data(), bufferSize[0], cudaMemcpyHostToDevice, stream); and curInput.data() does not have ehough time to load into GPU memory. In result context->execute(BATCH_SIZE, buffers); executes on previous image.

cudaStreamSynchronize(stream); solved this problem.