YOLOv8 ONNX Compilation in TDA4VM Evaluation Board:
I am following this link https://github.com/TexasInstruments/edgeai-tidl-tools/blob/master/docs/custom_model_evaluation.md#custom-model-evaluation to compile my trained yolov8 model and make it ready for inference on TDA4VM Board using realsense camera when i run the onnxrt_ep.py after making required changes for the trained onnx model in model_config.py I am facing the following issue
jayant_14@Jayant14:~/edgeai-tidl-tools/examples/osrt_python/ort$ python3 onnxrt_ep.py
Available execution providers : ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
Running 5 Models - ['cl-ort-resnet18-v1', 'cl-ort-caffe_squeezenet_v1_1', 'ss-ort-deeplabv3lite_mobilenetv2', 'od-ort-ssd-lite_mobilenetv2_fpn', 'yolov8s6_640_onnx']
Running_Model : cl-ort-resnet18-v1
Running_Model : cl-ort-caffe_squeezenet_v1_1
Running_Model : ss-ort-deeplabv3lite_mobilenetv2
Running_Model : od-ort-ssd-lite_mobilenetv2_fpn
Running_Model : yolov8s6_640_onnx
libtidl_onnxrt_EP loaded 0x557c2fc3c440
2023-11-03 17:08:52.947156290 [E:onnxruntime:, inference_session.cc:1311 operator()] Exception during initialization: basic_string::_M_construct null not valid
Process Process-2:
Traceback (most recent call last):
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/jayant_14/edgeai-tidl-tools/examples/osrt_python/ort/onnxrt_ep.py", line 194, in run_model
sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
self._create_inference_session(providers, provider_options)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 315, in _create_inference_session
sess.initialize_session(providers, provider_options)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: basic_string::_M_construct null not valid
libtidl_onnxrt_EP loaded 0x557c2febe920
2023-11-03 17:08:53.135978865 [E:onnxruntime:, inference_session.cc:1311 operator()] Exception during initialization: std::bad_alloc
Process Process-3:
Traceback (most recent call last):
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/jayant_14/edgeai-tidl-tools/examples/osrt_python/ort/onnxrt_ep.py", line 194, in run_model
sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
self._create_inference_session(providers, provider_options)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 315, in _create_inference_session
sess.initialize_session(providers, provider_options)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: std::bad_alloc
libtidl_onnxrt_EP loaded 0x557c305611c0
Process Process-5:
Traceback (most recent call last):
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/jayant_14/edgeai-tidl-tools/examples/osrt_python/ort/onnxrt_ep.py", line 194, in run_model
sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
self._create_inference_session(providers, provider_options)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 310, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from /home/jayant_14/edgeai-tidl-tools/models/public/openvino.onnx failed:/home/a0496663/work/edgeaitidltools/rel90/onnx/onnxruntime_bit/onnxruntime/onnxruntime/core/graph/model.cc:111 onnxruntime::Model::Model(onnx::ModelProto&&, const PathString&, const IOnnxRuntimeOpSchemaRegistryList*, const onnxruntime::logging::Logger&) Unknown model file format version.
2023-11-03 17:08:53.463571139 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463782148 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463793189 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463800192 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463806905 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463816844 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463829828 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463841480 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463851069 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463862190 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463875184 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463887978 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463898037 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.463962299 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.464002786 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.464043753 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.464102735 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.464171224 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.464211981 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-11-03 17:08:53.464253500 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
libtidl_onnxrt_EP loaded 0x557c2fcda7a0
2023-11-03 17:08:53.581464433 [E:onnxruntime:, inference_session.cc:1311 operator()] Exception during initialization: basic_string::_M_construct null not valid
Process Process-4:
Traceback (most recent call last):
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/jayant_14/edgeai-tidl-tools/examples/osrt_python/ort/onnxrt_ep.py", line 194, in run_model
sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
self._create_inference_session(providers, provider_options)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 315, in _create_inference_session
sess.initialize_session(providers, provider_options)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: basic_string::_M_construct null not valid
2023-11-03 17:08:53.711376396 [E:onnxruntime:, inference_session.cc:1311 operator()] Exception during initialization: basic_string::_M_construct null not valid
Process Process-1:
Traceback (most recent call last):
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/jayant_14/edgeai-tidl-tools/examples/osrt_python/ort/onnxrt_ep.py", line 194, in run_model
sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
self._create_inference_session(providers, provider_options)
File "/home/jayant_14/.pyenv/versions/3.10.13/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 315, in _create_inference_session
sess.initialize_session(providers, provider_options)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: basic_string::_M_construct null not valid