I build engine successfully with:
engine = tensorrt.legacy.lite.Engine(framework=“c1”,
deployfile=“fcn8s.prototxt”,…
but when i use engine.infer() having some error,
out = engine.infer(test_data)
the test_data shape is CHW.
error:
File “/home/chenfei/anaconda3/lib/python3.6/site-packages/tensorrt/legacy/lite/init.py”, line 710, in infer
cuda.memcpy_htod_async(self.d_input[i], np.ascontiguousarray(input_data[i][n].astype(self.alloc_data_type.input_type()), stream)
pycuda._driver.LogicError: cuMemcpyHtoDAsync failed: invalid argument
/home/chenfei/anaconda3/lib/python3.6/site-packages/tensorrt/legacy/lite/init.py:305: DeprecationWarning: Use del context instead.
You can suppress these warnings by setting tensorrt.legacy._deprecated_helpers.SUPPRESS_DEPRECATION_WARNINGS=True
after importing, or setting the TRT_SUPPRESS_DEPRECATION_WARNINGS
environment variable to 1
self.context.destroy()
/home/chenfei/anaconda3/lib/python3.6/site-packages/tensorrt/legacy/lite/init.py:307: DeprecationWarning: Use del engine instead.
You can suppress these warnings by setting tensorrt.legacy._deprecated_helpers.SUPPRESS_DEPRECATION_WARNINGS=True
after importing, or setting the TRT_SUPPRESS_DEPRECATION_WARNINGS
environment variable to 1
self.engine.destroy()
/home/chenfei/anaconda3/lib/python3.6/site-packages/tensorrt/legacy/lite/init.py:309: DeprecationWarning: Use del runtime instead.
You can suppress these warnings by setting tensorrt.legacy._deprecated_helpers.SUPPRESS_DEPRECATION_WARNINGS=True
after importing, or setting the TRT_SUPPRESS_DEPRECATION_WARNINGS
environment variable to 1
self.runtime.destroy()
PyCUDA ERROR: The context stack was not empty upon module cleanup.
A context was still active when the context stack was being
cleaned up. At this point in our execution, CUDA may already
have been deinitialized, so there is no way we can finish
cleanly. The program will be aborted now.
Use Context.pop() to avoid this problem.
Aborted (core dumped)