'NoneType' object has no attribute 'create_execution_context'

hi,


After I update the jetpack and pytorch, find i can’t run the Object-Following demo.
i run the lines:
from jetbot import ObjectDetector
model = ObjectDetector(‘ssd_mobilenet_v2_coco.engine’)

get error as below:


AttributeError Traceback (most recent call last)
in
1 from jetbot import ObjectDetector
2
----> 3 model = ObjectDetector(‘ssd_mobilenet_v2_coco.engine’)

/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/object_detection.py in init(self, engine_path, preprocess_fn)
27 load_plugins()
28 self.trt_model = TRTModel(engine_path, input_names=[TRT_INPUT_NAME],
—> 29 output_names=[TRT_OUTPUT_NAME, TRT_OUTPUT_NAME + ‘_1’])
30 self.preprocess_fn = preprocess_fn
31

/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/tensorrt_model.py in init(self, engine_path, input_names, output_names, final_shapes)
57 with open(engine_path, ‘rb’) as f:
58 self.engine = self.runtime.deserialize_cuda_engine(f.read())
—> 59 self.context = self.engine.create_execution_context()
60
61 if input_names is None:

AttributeError: ‘NoneType’ object has no attribute ‘create_execution_context’

my device operating env:
ubuntu 18.04
jetpack4.5.1
cuda 10.2
pytorch 1.7
tensor RT7.1
how can i solve this error?
plz

Hi,

Do you have the ssd_mobilenet_v2_coco.engine located in the sample?
Based on the error, it seems that the script cannot find it correctly.

Thanks.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.