I have a python program and i have following code snippet inside that .py file, which converts the ONNX model to a TRT engine using trtexec :
if USE_FP16:
subprocess.run([sys.executable, "-c", "trtexec --onnx=rmpx.onnx --saveEngine=rmpx_engine_pytorch.trt --explicitBatch --fp16"])
else:
subprocess.run([sys.executable, "-c", "trtexec --onnx=rmpx.onnx --saveEngine=rmpx_engine_pytorch.trt --explicitBatch"])
f = open("/home/my_username/github/TensorRT/quickstart/IntroNotebooks/rmpx_engine_pytorch.trt", "rb")
But this subprocess doesnt generate trt file. i get file not found error. does someone know what i am doing wrong here?