Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'create_execution_context' #3

Open
Daryatnt opened this issue Apr 20, 2022 · 2 comments

Comments

@Daryatnt
Copy link

HI
any idea what is the problem


  File "test.py", line 8, in <module>
    for image, bboxes in wrapper.detect_from_webcam(0): # Gets detection and image from the usb camera with id 0
  File "/home/jetson/jetson_yolov5_tensorrt/yolov5_trt/trt_wrapper.py", line 158, in detect_from_webcam
    for image, bboxes in self.detect_from_video(cap):
  File "/home/jetson/jetson_yolov5_tensorrt/yolov5_trt/trt_wrapper.py", line 146, in detect_from_video
    with self.create_session() as session:
  File "/home/jetson/jetson_yolov5_tensorrt/yolov5_trt/trt_wrapper.py", line 44, in __enter__
    self.context = self.engine.create_execution_context()
AttributeError: 'NoneType' object has no attribute 'create_execution_context'

@alxmamaev
Copy link
Owner

Probably something is wrong with the model deserialization, that's happening here. You may check TensorRT docs for this method, I think that is a problem with the model conversion.

@danielzhangau
Copy link

Add ctypes.CDLL(plugin_lib_path) solved my case.

After you build your engine file, there will be a libmyplugins.so file generated as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants