Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
debug: fix the first batch output unsync issue
Browse files Browse the repository at this point in the history
  • Loading branch information
royinx committed Aug 15, 2023
1 parent 263437e commit a652cec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion samples/SampleTensorRTResnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,7 @@ def run_inference(self, tensor_image) -> str:
for out in self.outputs:
cuda.memcpy_dtoh_async(out.host, out.device, self.stream)

self.stream.synchronize()
# Find most probable image type and return resnet categoy description
[result] = [out.host for out in self.outputs]
return resnet_categories[np.argmax(result)]
Expand Down Expand Up @@ -1311,7 +1312,7 @@ def infer_on_video(gpu_id: int, input_video: str, trt_nn_file: str):
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Provide gpu id and path to input video file.")
exit
exit(1)

gpu_id = int(sys.argv[1])
input_video = sys.argv[2]
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ def get_cupy() -> str:
"dev": ["pycuda", "pyopengl", "torch", "torchvision", "opencv-python", "onnx", "tensorrt", f"PytorchNvCodec @ file://{os.getcwd()}/src/PytorchNvCodec/"],
"samples": ["pycuda", "pyopengl", "torch", "torchvision", "opencv-python", "onnx", "tensorrt", "tqdm", cupy, PytorchNvCodec],
"tests": ["pycuda", "pyopengl", "torch", "torchvision", "opencv-python", PytorchNvCodec],
"torch": ["torch", "torchvision", "opencv-python", PytorchNvCodec],
"torch": ["torch", "torchvision", PytorchNvCodec],
"tensorrt": ["torch", "torchvision", cupy, PytorchNvCodec],
},
dependency_links=[
"https://pypi.ngc.nvidia.com"
],
packages=["PyNvCodec"],
package_data={"PyNvCodec": ["__init__.pyi"]},
package_dir={"": "src"},
Expand Down

0 comments on commit a652cec

Please sign in to comment.