I am currently using the following repository to convert Yolo v3 to TensorRT.
The same repository is present in the NGC container of TensorRT 5.1.
I can successfully convert YOLO to .trt file but getting a segmentation error on inference.
TensorRT version : 188.8.131.52
CUDA version : 10.1
cuDNN version : 7.4.2
GPU : V100 (AWS)
Error Dump :-
Loading ONNX file from path yolov3.onnx... Beginning ONNX file parsing Completed parsing of ONNX file Building an engine from file yolov3.onnx; this may take a while... Completed creating Engine Running inference on image dog.jpg... Fatal Python error: Segmentation fault Current thread 0x00007fbb1850b700 (most recent call first): File "/workspace/tensorrt/samples/python/yolov3_onnx/../common.py", line 145 in do_inference File "onnx_to_tensorrt.py", line 160 in main File "onnx_to_tensorrt.py", line 183 in <module> Segmentation fault (core dumped)
Below is the function where it throws the error:-
def do_inference(context, bindings, inputs, outputs, stream, batch_size=1): start = time.time() # Transfer input data to the GPU. [cuda.memcpy_htod_async(inp.device, inp.host, stream) for inp in inputs] # Run inference. context.execute_async(batch_size=batch_size, bindings=bindings, stream_handle=stream.handle) # Transfer predictions back from the GPU. [cuda.memcpy_dtoh_async(out.host, out.device, stream) for out in outputs] # Synchronize the stream stream.synchronize() # Return only the host outputs. print("=> time: %.4f" %(time.time()-start)) return [out.host for out in outputs]
Any help is appreciated.