The following two blob helps. However, did not provide detail.
I end up with the following code:
f = open(‘/home/trafficcountuser/sl/testpy/resnet18_detector_baru.engine’, ‘rb’)
runtime = trt.Runtime(TRT_LOGGER)
engine = runtime.deserialize_cuda_engine(f.read())
sourceFileDir = os.path.dirname(os.path.abspath(file))
sourceFileDir = os.path.abspath(os.path.join(sourceFileDir,“…/”))
fileName = os.path.join(sourceFileDir, “runTime”, “Image640x360.bmp”)
thisImage = cv2.imread(fileName)
result = engine.infer(thisImage) # Single function for inference
There is an error on the last line:
Exception has occurred: AttributeError
‘tensorrt.tensorrt.ICudaEngine’ object has no attribute ‘infer’