Open zmtttt opened 7 months ago
AttributeError: 'NoneType' object has no attribute 'create_execution_context'产生的原因可能是engine没有成功建立,可以检查一下engine的路径。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
(base) zhaomt@gyu3nj-MS-7D54:~/com/tensorrtx/yolov9$ python yolov9_trt.py [04/22/2024-17:58:10] [TRT] [I] Loaded engine size: 179 MiB [04/22/2024-17:58:10] [TRT] [E] 1: [runtime.cpp::parsePlan::314] Error Code 1: Serialization (Serialization assertion plan->header.magicTag == rt::kPLAN_MAGIC_TAG failed.) Traceback (most recent call last): File "/home/zhaomt/com/tensorrtx/yolov9/yolov9_trt.py", line 435, in
yolov9_wrapper = yolov9TRT(engine_file_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zhaomt/com/tensorrtx/yolov9/yolov9_trt.py", line 87, in init
context = engine.create_execution_context()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'create_execution_context'
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)