NVIDIA-AI-IOT / jetbot

An educational AI robot based on NVIDIA Jetson Nano.
MIT License
2.97k stars 1.02k forks source link

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

Open jiapei100 opened 11 months ago

jiapei100 commented 11 months ago
from jetbot import ObjectDetector

model = ObjectDetector('ssd_mobilenet_v2_coco.engine')

The above code still brought me the following ERROR messages:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-78c468b59bd4> in <module>
      1 from jetbot import ObjectDetector
      2 
----> 3 model = ObjectDetector('ssd_mobilenet_v2_coco.engine')

~/.local/lib/python3.6/site-packages/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 

~/.local/lib/python3.6/site-packages/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'

Can anybody let me know how to successfully load ssd_mobilenet_v2_coco.engine ?? BTW, I'm already using v0.4 (latest)

sriharish-324 commented 7 months ago

Did you got any solution for this

cccapital0107 commented 4 months ago

The problem is that jetpack 4.5 doesn't support that file.

Can someone provide the file with jetpack 4.5 support?

ssd_mobilenet_v2_coco.engine

omisha-bajoria commented 1 month ago

The problem is that jetpack 4.5 doesn't support that file.

Can someone provide the file with jetpack 4.5 support?

ssd_mobilenet_v2_coco.engine

Were you able to find the compatible file or work something else out?