This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TDA4VM:自定义模型创建问题(edge-ai tidl-tools)

Guru**** 2538955 points
Other Parts Discussed in Thread: TDA4VM

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1108588/tda4vm-custom-model-creation-problem-edge-ai-tidl-tools

器件型号:TDA4VM

您好!
我有 TDA4VM Jacinto J7 EVM 套件。 我按照 github.com/.../edgeai-yolov5 repo 培训了一个定制模型。 我使用"python3 train.py --data data.yaml--cfg yolov5l6.yaml--rands 'yolov5l6.pt --batche-size 40"开始定制培训,然后使用"python3 export.py --run/exp5/rands/best.pt --img 640 --batch 1 --Simplify --nx conversion 作为结果文件和.nopx 文件集进行应用。  我将其复制到使用">github.com/.../edgeai-tidl-tools" 存储库创建的"models"文件夹,并进行了以下更改。 但模型工件的创建被中断。 问题可能出在哪呢?

我共享了终端日志文件。

tidl 工具重新安装

sefau18@ubuntu:~$ git clone github.com/.../edgeai-tidl-tools.git
Cloning into 'edgeai-tidl-tools'...
remote: Enumerating objects: 2166, done.
remote: Counting objects: 100% (460/460), done.
remote: Compressing objects: 100% (138/138), done.
remote: Total 2166 (delta 349), reused 380 (delta 306), pack-reused 1706
Receiving objects: 100% (2166/2166), 10.48 MiB | 3.40 MiB/s, done.
Resolving deltas: 100% (1335/1335), done.

sefau18@ubuntu:~$ export DEVICE=j7

sefau18@ubuntu:~$ cd edgeai-tidl-tools

sefau18@ubuntu:~/edgeai-tidl-tools$ pip3 install -r requirements_pc.txt 
Defaulting to user installation because normal site-packages is not writeable
Collecting git+github.com/.../caffe2onnx (from -r requirements_pc.txt (line 12))
  Cloning github.com/.../caffe2onnx to /tmp/pip-req-build-96mf9b4d
  Running command git clone --filter=blob:none -q github.com/.../caffe2onnx /tmp/pip-req-build-96mf9b4d
  Resolved github.com/.../caffe2onnx to commit b7e73feed3bbc5ddbdf25b87af93a2bae596055d
  Preparing metadata (setup.py) ... done
Collecting dlr==1.10.0
  Downloading github.com/.../dlr-1.10.0-py3-none-any.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB 3.2 MB/s            
Collecting tvm==0.8.dev0
  Downloading github.com/.../tvm-0.8.dev0-cp36-cp36m-linux_x86_64.whl (35.9 MB)
     |████████████████████████████████| 35.9 MB 4.4 MB/s            
Collecting onnxruntime-tidl==1.7.0
  Downloading github.com/.../onnxruntime_tidl-1.7.0-cp36-cp36m-linux_x86_64.whl (5.1 MB)
     |████████████████████████████████| 5.1 MB 4.4 MB/s            
Collecting tflite-runtime==2.4.0
  Downloading github.com/.../tflite_runtime-2.4.0-py3-none-any.whl (1.4 MB)
     |████████████████████████████████| 1.4 MB 4.1 MB/s            
Requirement already satisfied: numpy in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 1)) (1.19.5)
Requirement already satisfied: pyyaml in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 2)) (6.0)
Requirement already satisfied: protobuf==3.19.4 in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 3)) (3.19.4)
Requirement already satisfied: onnx==1.9.0 in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 4)) (1.9.0)
Requirement already satisfied: tflite in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 5)) (2.4.0)
Requirement already satisfied: pillow==8.2.0 in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 6)) (8.2.0)
Requirement already satisfied: flatbuffers==1.12.0 in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 7)) (1.12)
Requirement already satisfied: requests in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 8)) (2.27.1)
Requirement already satisfied: opencv-python==4.2.0.34 in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 9)) (4.2.0.34)
Requirement already satisfied: pytest in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 10)) (7.0.1)
Requirement already satisfied: graphviz in /home/sefau18/.local/lib/python3.6/site-packages (from -r requirements_pc.txt (line 11)) (0.8.4)
Requirement already satisfied: six in /home/sefau18/.local/lib/python3.6/site-packages (from onnx==1.9.0->-r requirements_pc.txt (line 4)) (1.16.0)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /home/sefau18/.local/lib/python3.6/site-packages (from onnx==1.9.0->-r requirements_pc.txt (line 4)) (4.1.1)
Requirement already satisfied: certifi>=2017.4.17 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r requirements_pc.txt (line 8)) (2022.5.18.1)
Requirement already satisfied: idna<4,>=2.5 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r requirements_pc.txt (line 8)) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r requirements_pc.txt (line 8)) (1.26.9)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r requirements_pc.txt (line 8)) (2.0.12)
Requirement already satisfied: importlib-metadata>=0.12 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r requirements_pc.txt (line 10)) (4.8.3)
Requirement already satisfied: attrs>=19.2.0 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r requirements_pc.txt (line 10)) (21.4.0)
Requirement already satisfied: tomli>=1.0.0 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r requirements_pc.txt (line 10)) (1.2.3)
Requirement already satisfied: iniconfig in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r requirements_pc.txt (line 10)) (1.1.1)
Requirement already satisfied: py>=1.8.2 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r requirements_pc.txt (line 10)) (1.11.0)
Requirement already satisfied: packaging in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r requirements_pc.txt (line 10)) (21.3)
Requirement already satisfied: pluggy<2.0,>=0.12 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r requirements_pc.txt (line 10)) (1.0.0)
Requirement already satisfied: distro in /home/sefau18/.local/lib/python3.6/site-packages (from dlr==1.10.0->-r requirements_pc.txt (line 13)) (1.7.0)
Requirement already satisfied: tornado in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r requirements_pc.txt (line 14)) (6.1)
Requirement already satisfied: cloudpickle in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r requirements_pc.txt (line 14)) (2.1.0)
Requirement already satisfied: psutil in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r requirements_pc.txt (line 14)) (5.9.1)
Requirement already satisfied: scipy in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r requirements_pc.txt (line 14)) (1.5.4)
Requirement already satisfied: decorator in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r requirements_pc.txt (line 14)) (5.1.1)
Requirement already satisfied: synr>=0.2.1 in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r requirements_pc.txt (line 14)) (0.6.0)
Requirement already satisfied: pybind11>=2.4.3 in /home/sefau18/.local/lib/python3.6/site-packages (from tflite-runtime==2.4.0->-r requirements_pc.txt (line 16)) (2.9.2)
Requirement already satisfied: zipp>=0.5 in /home/sefau18/.local/lib/python3.6/site-packages (from importlib-metadata>=0.12->pytest->-r requirements_pc.txt (line 10)) (3.6.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/sefau18/.local/lib/python3.6/site-packages (from packaging->pytest->-r requirements_pc.txt (line 10)) (3.0.9)

sefau18@ubuntu:~$ source ./setup.sh
X64 Architecture
Installing python packages...
Defaulting to user installation because normal site-packages is not writeable
Collecting git+github.com/.../caffe2onnx (from -r ./requirements_pc.txt (line 12))
  Cloning github.com/.../caffe2onnx to /tmp/pip-req-build-u14vy2nn
  Running command git clone --filter=blob:none -q github.com/.../caffe2onnx /tmp/pip-req-build-u14vy2nn
  Resolved github.com/.../caffe2onnx to commit b7e73feed3bbc5ddbdf25b87af93a2bae596055d
  Preparing metadata (setup.py) ... done
Collecting dlr==1.10.0
  Using cached github.com/.../dlr-1.10.0-py3-none-any.whl (2.2 MB)
Collecting tvm==0.8.dev0
  Using cached github.com/.../tvm-0.8.dev0-cp36-cp36m-linux_x86_64.whl (35.9 MB)
Collecting onnxruntime-tidl==1.7.0
  Using cached github.com/.../onnxruntime_tidl-1.7.0-cp36-cp36m-linux_x86_64.whl (5.1 MB)
Collecting tflite-runtime==2.4.0
  Using cached github.com/.../tflite_runtime-2.4.0-py3-none-any.whl (1.4 MB)
Requirement already satisfied: numpy in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 1)) (1.19.5)
Requirement already satisfied: pyyaml in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 2)) (6.0)
Requirement already satisfied: protobuf==3.19.4 in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 3)) (3.19.4)
Requirement already satisfied: onnx==1.9.0 in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 4)) (1.9.0)
Requirement already satisfied: tflite in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 5)) (2.4.0)
Requirement already satisfied: pillow==8.2.0 in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 6)) (8.2.0)
Requirement already satisfied: flatbuffers==1.12.0 in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 7)) (1.12)
Requirement already satisfied: requests in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 8)) (2.27.1)
Requirement already satisfied: opencv-python==4.2.0.34 in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 9)) (4.2.0.34)
Requirement already satisfied: pytest in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 10)) (7.0.1)
Requirement already satisfied: graphviz in /home/sefau18/.local/lib/python3.6/site-packages (from -r ./requirements_pc.txt (line 11)) (0.8.4)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /home/sefau18/.local/lib/python3.6/site-packages (from onnx==1.9.0->-r ./requirements_pc.txt (line 4)) (4.1.1)
Requirement already satisfied: six in /home/sefau18/.local/lib/python3.6/site-packages (from onnx==1.9.0->-r ./requirements_pc.txt (line 4)) (1.16.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r ./requirements_pc.txt (line 8)) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r ./requirements_pc.txt (line 8)) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r ./requirements_pc.txt (line 8)) (2022.5.18.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/sefau18/.local/lib/python3.6/site-packages (from requests->-r ./requirements_pc.txt (line 8)) (1.26.9)
Requirement already satisfied: importlib-metadata>=0.12 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r ./requirements_pc.txt (line 10)) (4.8.3)
Requirement already satisfied: attrs>=19.2.0 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r ./requirements_pc.txt (line 10)) (21.4.0)
Requirement already satisfied: iniconfig in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r ./requirements_pc.txt (line 10)) (1.1.1)
Requirement already satisfied: py>=1.8.2 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r ./requirements_pc.txt (line 10)) (1.11.0)
Requirement already satisfied: pluggy<2.0,>=0.12 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r ./requirements_pc.txt (line 10)) (1.0.0)
Requirement already satisfied: packaging in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r ./requirements_pc.txt (line 10)) (21.3)
Requirement already satisfied: tomli>=1.0.0 in /home/sefau18/.local/lib/python3.6/site-packages (from pytest->-r ./requirements_pc.txt (line 10)) (1.2.3)
Requirement already satisfied: distro in /home/sefau18/.local/lib/python3.6/site-packages (from dlr==1.10.0->-r ./requirements_pc.txt (line 13)) (1.7.0)
Requirement already satisfied: synr>=0.2.1 in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r ./requirements_pc.txt (line 14)) (0.6.0)
Requirement already satisfied: cloudpickle in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r ./requirements_pc.txt (line 14)) (2.1.0)
Requirement already satisfied: scipy in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r ./requirements_pc.txt (line 14)) (1.5.4)
Requirement already satisfied: decorator in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r ./requirements_pc.txt (line 14)) (5.1.1)
Requirement already satisfied: psutil in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r ./requirements_pc.txt (line 14)) (5.9.1)
Requirement already satisfied: tornado in /home/sefau18/.local/lib/python3.6/site-packages (from tvm==0.8.dev0->-r ./requirements_pc.txt (line 14)) (6.1)
Requirement already satisfied: pybind11>=2.4.3 in /home/sefau18/.local/lib/python3.6/site-packages (from tflite-runtime==2.4.0->-r ./requirements_pc.txt (line 16)) (2.9.2)
Requirement already satisfied: zipp>=0.5 in /home/sefau18/.local/lib/python3.6/site-packages (from importlib-metadata>=0.12->pytest->-r ./requirements_pc.txt (line 10)) (3.6.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/sefau18/.local/lib/python3.6/site-packages (from packaging->pytest->-r ./requirements_pc.txt (line 10)) (3.0.9)
--2022-06-10 00:45:41--  github.com/.../tidl_tools.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: objects.githubusercontent.com/.../a607f658-69fe-41b8-9d99-e1766df2fbca [following]
--2022-06-10 00:45:41--  objects.githubusercontent.com/.../a607f658-69fe-41b8-9d99-e1766df2fbca
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58937848 (56M) [application/octet-stream]
Saving to: ‘tidl_tools.tar.gz’

tidl_tools.tar.gz        100%[================================>]  56.21M  3.45MB/s    in 16s     

2022-06-10 00:45:58 (3.50 MB/s) - ‘tidl_tools.tar.gz’ saved [58937848/58937848]

--2022-06-10 00:45:59--  developer.arm.com/.../gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
Resolving developer.arm.com (developer.arm.com)... 104.64.124.88
Connecting to developer.arm.com (developer.arm.com)|104.64.124.88|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: armkeil.blob.core.windows.net/.../gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz [following]
--2022-06-10 00:46:00--  armkeil.blob.core.windows.net/.../gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
Resolving armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)... 52.239.137.100
Connecting to armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)|52.239.137.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 282132940 (269M) [application/octet-stream]
Saving to: ‘gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz’

gcc-arm-9.2-2019.12-x86_ 100%[================================>] 269.06M  1.97MB/s    in 2m 12s  

2022-06-10 00:48:12 (2.04 MB/s) - ‘gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz’ saved [282132940/282132940]

--2022-06-10 00:48:34--  github.com/.../libonnxruntime.so.1.7.0
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: objects.githubusercontent.com/.../3f847642-0e88-4a4a-a505-9b21b753bf23 [following]
--2022-06-10 00:48:35--  objects.githubusercontent.com/.../3f847642-0e88-4a4a-a505-9b21b753bf23
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13689328 (13M) [application/octet-stream]
Saving to: ‘libonnxruntime.so.1.7.0’

libonnxruntime.so.1.7.0  100%[================================>]  13.05M  3.64MB/s    in 4.5s    

2022-06-10 00:48:40 (2.91 MB/s) - ‘libonnxruntime.so.1.7.0’ saved [13689328/13689328]

--2022-06-10 00:48:40--  github.com/.../libtensorflow-lite.a
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: objects.githubusercontent.com/.../06c9c657-bf0b-403a-bec1-bcfb05c5ea0f [following]
--2022-06-10 00:48:40--  objects.githubusercontent.com/.../06c9c657-bf0b-403a-bec1-bcfb05c5ea0f
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8407288 (8.0M) [application/octet-stream]
Saving to: ‘libtensorflow-lite.a’

libtensorflow-lite.a     100%[================================>]   8.02M  3.54MB/s    in 2.3s    

2022-06-10 00:48:43 (3.54 MB/s) - ‘libtensorflow-lite.a’ saved [8407288/8407288]

/home/sefau18/edgeai-tidl-tools
fatal: destination path 'neo-ai-dlr' already exists and is not an empty directory.
fatal: destination path 'onnxruntime' already exists and is not an empty directory.
Device j7: Downloading tflite 2.4
fatal: destination path 'tensorflow' already exists and is not an empty directory.
--2022-06-10 00:48:43--  github.com/.../v1.12.0.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: codeload.github.com/.../v1.12.0 [following]
--2022-06-10 00:48:44--  codeload.github.com/.../v1.12.0
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1145348 (1.1M) [application/x-gzip]
Saving to: ‘v1.12.0.tar.gz’

v1.12.0.tar.gz           100%[================================>]   1.09M  3.34MB/s    in 0.3s    

2022-06-10 00:48:44 (3.34 MB/s) - ‘v1.12.0.tar.gz’ saved [1145348/1145348]

mv: cannot move 'flatbuffers-1.12.0' to 'flatbuffers/flatbuffers-1.12.0': Directory not empty
--2022-06-10 00:48:44--  github.com/.../4.1.0.zip
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: codeload.github.com/.../4.1.0 [following]
--2022-06-10 00:48:45--  codeload.github.com/.../4.1.0
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘4.1.0.zip’

4.1.0.zip                    [                 <=>             ]  87.55M  3.03MB/s    in 29s     

2022-06-10 00:49:14 (2.99 MB/s) - ‘4.1.0.zip’ saved [91806599]

Archive:  4.1.0.zip
371bba8f54560b374fbcd47e7e02f015ac4969ad
replace opencv-4.1.0/.editorconfig? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: opencv-4.1.0/.editorconfig  
  inflating: opencv-4.1.0/3rdparty/carotene/CMakeLists.txt  
  inflating: opencv-4.1.0/3rdparty/carotene/README.md  
  inflating: opencv-4.1.0/3rdparty/carotene/hal/CMakeLists.txt  
  inflating: opencv-4.1.0/3rdparty/carotene/hal/tegra_hal.hpp  
  inflating: opencv-4.1.0/3rdparty/carotene/include/carotene/definitions.hpp  
.
.
.
.
.
.
.
.
.
.
.
.
 inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Properties/AssemblyInfo.cs  
  inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Properties/WMAppManifest.xml  
  inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Resources/AppResources.Designer.cs  
  inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Resources/AppResources.resx  
  inflating: opencv-4.1.0/samples/wp8/readme.txt  
/home/sefau18
-- Looking for ccache - not found
-- libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.1.0-libjpeg-turbo
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
-- Checking for module 'gtk+-3.0'
--   No package 'gtk+-3.0' found
-- Checking for module 'gtk+-2.0'
--   No package 'gtk+-2.0' found
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY) 
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- OpenCV Python: during development append to PYTHONPATH: /home/sefau18/opencv-4.1.0/cmake/python_loader
-- 
-- General configuration for OpenCV 4.1.0 =====================================
--   Version control:               unknown
-- 
--   Platform:
--     Timestamp:                   2022-06-01T13:39:08Z
--     Host:                        Linux 5.4.0-110-generic x86_64
--     CMake:                       3.10.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               Release
-- 
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (13 files):         + SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (27 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (2 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs?:      NO
--     C++ Compiler:                /usr/bin/c++  (ver 7.5.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections  
--     Linker flags (Debug):        -Wl,--gc-sections  
--     ccache:                      NO
--     Precompiled headers:         YES
--     Extra dependencies:          ade gthread-2.0 glib-2.0 dl m pthread rt
--     3rdparty dependencies:       libprotobuf zlib libjpeg-turbo libwebp libpng libtiff libjasper IlmImf quirc
-- 
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video
--     Disabled:                    videoio world
--     Disabled by dependency:      -
--     Unavailable:                 java js python2 ts
--     Applications:                apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI: 
--     GTK+:                        NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        build (ver 1.2.11)
--     JPEG:                        build-libjpeg-turbo (ver 2.0.2-62)
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         build (ver 1.6.36)
--     TIFF:                        build (ver 42 - 4.0.10)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      NO
--       avcodec:                   NO
--       avformat:                  NO
--       avutil:                    NO
--       swscale:                   NO
--       avresample:                NO
--     GStreamer:                   NO
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (built-in)
-- 
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.5.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/sefau18/opencv-4.1.0/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.6.9)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.6m.so (ver 3.6.9)
--     numpy:                       /home/sefau18/.local/lib/python3.6/site-packages/numpy/core/include (ver 1.19.5)
--     install path:                lib/python3.6/dist-packages/cv2/python-3.6
-- 
--   Python (for build):            /usr/bin/python2.7
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sefau18/opencv-4.1.0/cmake
[  2%] Built target ade
[  3%] Built target opencv_features2d_pch_dephelp
[  5%] Built target zlib
[  5%] Built target opencv_imgproc_pch_dephelp
[  5%] Built target opencv_videoio_plugins
[  5%] Built target opencv_dnn_pch_dephelp
[  5%] Built target quirc
[  5%] Built target opencv_stitching_pch_dephelp
[  5%] Built target opencv_ml_pch_dephelp
[  5%] Built target opencv_core_pch_dephelp
[  5%] Built target opencv_objdetect_pch_dephelp
[  6%] Built target opencv_calib3d_pch_dephelp
[  6%] Built target opencv_video_pch_dephelp
[  6%] Built target opencv_flann_pch_dephelp
[  8%] Built target opencv_highgui_pch_dephelp
[ 17%] Built target libwebp
[  5%] Built target gen_opencv_python_source
[ 18%] Built target opencv_gapi_pch_dephelp
[ 22%] Built target libjasper
[ 29%] Built target opencv_photo_pch_dephelp
[ 34%] Built target libtiff
[ 39%] Built target libjpeg-turbo
[ 29%] Built target libprotobuf
[ 40%] Built target pch_Generate_opencv_features2d
[ 40%] Built target opencv_imgcodecs_pch_dephelp
[ 40%] Built target pch_Generate_opencv_dnn
[ 40%] Built target pch_Generate_opencv_calib3d
[ 42%] Built target libpng
[ 43%] Built target pch_Generate_opencv_imgproc
[ 43%] Built target pch_Generate_opencv_ml
[ 44%] Built target pch_Generate_opencv_video
[ 44%] Built target pch_Generate_opencv_stitching
[ 44%] Built target pch_Generate_opencv_highgui
[ 44%] Built target pch_Generate_opencv_flann
[ 44%] Built target pch_Generate_opencv_core
[ 44%] Built target pch_Generate_opencv_gapi
[ 44%] Built target pch_Generate_opencv_photo
[ 44%] Built target pch_Generate_opencv_objdetect
[ 44%] Built target pch_Generate_opencv_imgcodecs
[ 51%] Built target IlmImf
[ 60%] Built target opencv_core
[ 60%] Built target opencv_version
[ 62%] Built target opencv_ml
[ 62%] Built target opencv_flann
[ 71%] Built target opencv_imgproc
[ 73%] Built target opencv_imgcodecs
[ 75%] Built target opencv_photo
[ 75%] Built target opencv_highgui
[ 79%] Built target opencv_gapi
[ 90%] Built target opencv_dnn
[ 92%] Built target opencv_features2d
[ 95%] Built target opencv_calib3d
[ 96%] Built target opencv_objdetect
[100%] Built target opencv_stitching
[100%] Built target opencv_video
[100%] Built target opencv_python3
/home/sefau18
mkdir: cannot create directory ‘/home/sefau18/ArmNNDelegate’: File exists
fatal: destination path 'armnn' already exists and is not an empty directory.
Already on 'branches/armnn_22_02'
Your branch is up to date with 'origin/branches/armnn_22_02'.
ln: failed to create symbolic link 'armnn/armnn': File exists
--2022-06-10 00:50:16--  github.com/.../libarmnnDelegate.so
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: objects.githubusercontent.com/.../67c86783-ad1b-4288-a84f-6da5b8d12615 [following]
--2022-06-10 00:50:16--  objects.githubusercontent.com/.../67c86783-ad1b-4288-a84f-6da5b8d12615
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 418840 (409K) [application/octet-stream]
Saving to: ‘libarmnnDelegate.so’

libarmnnDelegate.so      100%[================================>] 409.02K  --.-KB/s    in 0.1s    

2022-06-10 00:50:17 (2.73 MB/s) - ‘libarmnnDelegate.so’ saved [418840/418840]

--2022-06-10 00:50:17--  github.com/.../libarmnn.so
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: objects.githubusercontent.com/.../a56495be-9f45-4dc6-a069-e8ecc672026a [following]
--2022-06-10 00:50:17--  objects.githubusercontent.com/.../a56495be-9f45-4dc6-a069-e8ecc672026a
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29941792 (29M) [application/octet-stream]
Saving to: ‘libarmnn.so’

libarmnn.so              100%[================================>]  28.55M  3.16MB/s    in 10s     

2022-06-10 00:50:28 (2.77 MB/s) - ‘libarmnn.so’ saved [29941792/29941792]

./edgeeai-tidl-tools/examples/osrT_python common_utils.py 添加

'best' : {
        'model_path' : os.path.join('/home/sefau18/edgeai-tidl-tools/models/public/best.onnx'),
        'mean': [0, 0, 0],
        'std' : [0.003921568627,0.003921568627,0.003921568627],
        'num_images' : numImages,
        'num_classes': 36,
        'model_type': 'od',
        'od_type' : 'YoloV5',
        'framework' : '',
        'meta_layers_names_list' : os.path.join('/home/sefau18/edgeai-tidl-tools/models/public/best.prototxt'),
        'session_name' : 'onnxrt' ,
        'meta_arch_type' : 6
    },

./edgeeai-tidl-tools/examples/osrT_python /ort/onnxrt_ep.py 编辑

models = ['cl-ort-resnet18-v1', 'cl-ort-caffe_squeezenet_v1_1', 'ss-ort-deeplabv3lite_mobilenetv2', 'od-ort-ssd-lite_mobilenetv2_fpn']

更改为

models = ['best']

并运行

sefau18@ubuntu:~/edgeai-tidl-tools$ cd examples/osrt_python/ort
sefau18@ubuntu:~/edgeai-tidl-tools/examples/osrt_python/ort$ python3 onnxrt_ep.py -c
Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']

Running 1 Models - ['best']


Running_Model :  best  

TIDL Meta PipeLine (Proto) File  : /home/sefau18/edgeai-tidl-tools/models/public/best.prototxt  
yolo_v3
yolo_v3
Number of OD backbone nodes = 0 
Size of odBackboneNodeIds = 0 

Preliminary subgraphs created = 0 
Final number of subgraphs created are : 0, - Offloaded Nodes - 0, Total Nodes - 1 
TIDL Meta PipeLine (Proto) File  : /home/sefau18/edgeai-tidl-tools/models/public/best.prototxt  
yolo_v3
yolo_v3
Number of OD backbone nodes = 0 
Size of odBackboneNodeIds = 0 

Preliminary subgraphs created = 0 
Final number of subgraphs created are : 0, - Offloaded Nodes - 0, Total Nodes - 1 
TIDL Meta PipeLine (Proto) File  : /home/sefau18/edgeai-tidl-tools/models/public/best.prototxt  
yolo_v3
yolo_v3
Number of OD backbone nodes = 328 
Size of odBackboneNodeIds = 328 

Preliminary subgraphs created = 1 
Final number of subgraphs created are : 1, - Offloaded Nodes - 434, Total Nodes - 434

但模型工件的创建被中断。 问题可能出在哪呢?

提前感谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Sefa、

     您能分享您得到的误差吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您能试试 yolov5s6吗

    您可以先尝试我们共享的 yolov5s6模型、然后再尝试您将要培训的模型。

    只需尝试了解此故障是否是由于内存不足所致、因为 yolov5l6是一个大型模型。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    在 onnxrt_ep.py 文件中添加"onnx 形状推理"部分可解决该问题。 现在、已创建"工件"文件夹。

        #onnx shape inference
        if not os.path.isfile(os.path.join(models_base_path, model + '_shape.onnx')):
            print("Writing model with shapes after running onnx shape inference -- ", os.path.join(models_base_path, model + '_shape.onnx'))
            onnx.shape_inference.infer_shapes_path(config['model_path'], config['model_path'])#os.path.join(models_base_path, model + '_shape.onnx'))

    sefau18@ubuntu:~/edgeai-tidl-tools/examples/osrt_python/ort$ python3 onnxrt_ep.py -c
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    Writing model with shapes after running onnx shape inference --  ../../../models/public/best_shape.onnx
    TIDL Meta PipeLine (Proto) File  : /home/sefau18/edgeai-tidl-tools/models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Number of OD backbone nodes = 0 
    Size of odBackboneNodeIds = 0 
    
    Preliminary subgraphs created = 0 
    Final number of subgraphs created are : 0, - Offloaded Nodes - 0, Total Nodes - 1 
    TIDL Meta PipeLine (Proto) File  : /home/sefau18/edgeai-tidl-tools/models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Number of OD backbone nodes = 0 
    Size of odBackboneNodeIds = 0 
    
    Preliminary subgraphs created = 0 
    Final number of subgraphs created are : 0, - Offloaded Nodes - 0, Total Nodes - 1 
    TIDL Meta PipeLine (Proto) File  : /home/sefau18/edgeai-tidl-tools/models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Number of OD backbone nodes = 328 
    Size of odBackboneNodeIds = 328 
    
    Preliminary subgraphs created = 1 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 434, Total Nodes - 434 
    TIDL Meta PipeLine (Proto) File  : /home/sefau18/edgeai-tidl-tools/models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Warning : Requested Output Data Convert Layer is not Added to the network, It is currently not Optimal
    
     ************** Frame index 1 : Running float import ************* 
    INFORMATION: [TIDL_ResizeLayer] Resize_195 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_219 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_243 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    WARNING: [TIDL_E_DATAFLOW_INFO_NULL] ti_cnnperfsim.out fails to allocate memory in MSMC. Please look into perfsim log. This model can only be used on PC emulation, it will get fault on target.
    ****************************************************
    **          4 WARNINGS          0 ERRORS          **
    ****************************************************
     0.0s:  VX_ZONE_INIT:Enabled
     0.36s:  VX_ZONE_ERROR:Enabled
     0.40s:  VX_ZONE_WARNING:Enabled
     0.1132s:  VX_ZONE_INIT:[tivxInit:178] Initialization Done !!!
    
    **********  Frame Index 1 : Running float inference **********
    
    **********  Frame Index 2 : Running fixed point mode for calibration **********
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   62484.14  .... ..... ... .... .....
    #    1 . .. T   64024.67  .... ..... ... .... .....
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   38282.48  .... ..... ... .... .....
    #    1 . .. T   38302.39  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 0 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   38131.61  .... ..... ... .... .....
    #    1 . .. T   38735.09  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 1 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   39747.21  .... ..... ... .... .....
    #    1 . .. T   40037.01  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 2 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   39015.66  .... ..... ... .... .....
    #    1 . .. T   39431.54  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 3 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   38673.23  .... ..... ... .... .....
    #    1 . .. T   36513.44  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 4 completed ************************ 
     
     
     
    
    ------------------ Network Compiler Traces -----------------------------
    successful Memory allocation
    substitute string tidl_net_ not found
    INFORMATION: [TIDL_ResizeLayer] Resize_195 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_219 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_243 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    ****************************************************
    **          3 WARNINGS          0 ERRORS          **
    ****************************************************
    
     
    Completed_Model :     1, Name : best                                              , Total time :  333155.71, Offload Time :   62897.73 , DDR RW MBs : 0, Output File : py_out_best_ADE_val_00001801.jpg 
     
     
    sefau18@ubuntu:~/edgeai-tidl-tools/examples/osrt_python/ort$ 
    

    best/
    ├── allowedNode.txt
    ├── best.onnx
    ├── detections_tidl_io_1.bin
    ├── detections_tidl_net.bin
    ├── onnxrtMetaData.txt
    ├── param.yaml
    └── tempDir
        ├── detections_calib_raw_data.bin
        ├── detections_tidl_io_1.bin
        ├── detections_tidl_io__LayerPerChannelMean.bin
        ├── detections_tidl_io_.perf_sim_config.txt
        ├── detections_tidl_io_.qunat_stats_config.txt
        ├── detections_tidl_io__stats_tool_out.bin
        ├── detections_tidl_net
        │   ├── bufinfolog.csv
        │   ├── bufinfolog.txt
        │   └── perfSimInfo.bin
        ├── detections_tidl_net.bin
        ├── detections_tidl_net.bin.layer_info.txt
        ├── detections_tidl_net.bin_netLog.txt
        ├── detections_tidl_net.bin_paramDebug.csv
        ├── detections_tidl_net.bin.svg
        ├── graphvizInfo.txt
        └── runtimes_visualization.svg
    
    2 directories, 22 files
    

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/latest/exports/docs/inference_models.html

    如上文档所述、我使用 TDA4VM 上的 edgeai 应用 python 手动创建推理的文件夹结构。

    然后、我将创建的文件夹复制到 TDA4M。

    然后、我编辑 TDA4VM 上的 onject_detection.yAML 文件。

    title: "YoloV5 Object Detection Test"
    log_level: 2
    inputs:
        input0:
            source: /dev/video2
            format: jpeg
            width: 1280
            height: 720
            framerate: 30
        input1:
            source: /opt/edge_ai_apps/data/videos/video_0000_h264.mp4
            format: h264_sw
            width: 1280
            height: 720
            framerate: 30
            loop: True
        input2:
            source: /dev/video18
            width: 1936
            height: 1100
            format: rggb12
            subdev-id: 2
            framerate: 30
            sen-id: imx390
            ldc: True 
        input3:
            source: /opt/edge_ai_apps/data/images/%04d.jpg
            width: 1280
            height: 720
            index: 0
            framerate: 1
            loop: True
    models:
        model0:
            model_path: /opt/model_zoo/best_onnx
            viz_threshold: 0.6
        model1:
            model_path: /opt/model_zoo/od-8100_onnxrt_coco_edgeai-yolov5_yolov5s6_640_ti_lite_37p4_56p0_onnx
            viz_threshold: 0.6
        model2:
            model_path: /opt/model_zoo/ONR-OD-8050-ssd-lite-regNetX-800mf-fpn-bgr-mmdet-coco-512x512
            viz_threshold: 0.6
    outputs:
        output0:
            sink: kmssink
            width: 1920
            height: 1080
        output1:
            sink: /opt/edge_ai_apps/data/output/videos/output_video2.mkv
            width: 1920
            height: 1080
        output2:
            sink: /opt/edge_ai_apps/data/output/images/output_image_%04d.jpg
            width: 1920
            height: 1080
    
    flows:
        flow0:
            input: input2
            models: [model0]
            outputs: [output0]
            mosaic:
                mosaic0:
                    width:  1280
                    height: 720
                    pos_x:  320
                    pos_y:  180

    这是我在 TDA4VM 上得到的错误。

    root@j7-evm:/opt/edge_ai_apps# ./init_script.sh 
    IMX390 Camera 0 detected
        device = /dev/video18
        name = imx390 10-0021
        format = [fmt:SRGGB12_1X12/1936x1100 field: none]
        subdev_id = /dev/v4l-subdev7
        isp_required = yes
        ldc_required = yes
    root@j7-evm:/opt/edge_ai_apps# cd apps_python/
    root@j7-evm:/opt/edge_ai_apps/apps_python# ./app_edgeai.py ../configs/object_detection.yaml 
    libtidl_onnxrt_EP loaded 0x2a7d53c0 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 434, Total Nodes - 434 
    2022-06-15 05:46:45.764130779 [E:onnxruntime:, inference_session.cc:1310 operator()] Exception during initialization: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1
    
    Traceback (most recent call last):
      File "./app_edgeai.py", line 71, in <module>
        main(sys.argv)
      File "./app_edgeai.py", line 45, in main
        demo = EdgeAIDemo(config)
      File "/opt/edge_ai_apps/apps_python/edge_ai_class.py", line 74, in __init__
        model_obj = config_parser.Model(model_config)
      File "/opt/edge_ai_apps/apps_python/config_parser.py", line 136, in __init__
        self.run_time = RunTime(self)
      File "/opt/edge_ai_apps/apps_python/run_times.py", line 109, in __init__
        self.interpreter = onnxruntime.InferenceSession(params.model_path,\
      File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
        self._create_inference_session(providers, provider_options)
      File "/usr/lib/python3.8/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: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1
    
    root@j7-evm:/opt/edge_ai_apps/apps_python# 

    我不确定我是否遵循了正确的步骤。

    感谢您的回答

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    使用 edgeeai-tiddl-tools 中提供的脚本时、模型推理(使用编译的工件)是否起作用?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    正如我先前建议的、请尝试 yolov5s6并确保它正常工作。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    https://github.com/TexasInstruments/edgeai-yolov5/tree/master/pretrained_models/models/yolov5s6_640_ti_lite/weights

    如果我从上面的链接下载"best.pt 文件并执行完全相同的操作、我会得到相同的错误。

    root@j7-evm:/opt/edge_ai_apps/apps_python# ./app_edgeai.py ../configs/object_detection.yaml 
    libtidl_onnxrt_EP loaded 0x1973190 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 298, Total Nodes - 298 
    2022-06-15 07:30:20.151819751 [E:onnxruntime:, inference_session.cc:1310 operator()] Exception during initialization: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1
    
    Traceback (most recent call last):
      File "./app_edgeai.py", line 71, in <module>
        main(sys.argv)
      File "./app_edgeai.py", line 45, in main
        demo = EdgeAIDemo(config)
      File "/opt/edge_ai_apps/apps_python/edge_ai_class.py", line 74, in __init__
        model_obj = config_parser.Model(model_config)
      File "/opt/edge_ai_apps/apps_python/config_parser.py", line 136, in __init__
        self.run_time = RunTime(self)
      File "/opt/edge_ai_apps/apps_python/run_times.py", line 109, in __init__
        self.interpreter = onnxruntime.InferenceSession(params.model_path,\
      File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
        self._create_inference_session(providers, provider_options)
      File "/usr/lib/python3.8/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: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1

    https://github.com/TexasInstruments/edgeai-yolov5/blob/master/pretrained_models/modelartifacts/8bits/od-8100_onnxrt_coco_edgeai-yolov5_yolov5s6_640_ti_lite_37p4_56p0_onnx.tar.gz.link

    但在 TDA4VM 上运行之前编译的模型没有问题。 一切都正常工作、我可以在 TDA4M 屏幕上看到推理结果。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    使用我的自定义模型、我可以使用以下代码进行推断。

    sefau18@ubuntu:~/edgeai-tidl-tools/examples/osrt_python/ort$ python3 onnxrt_ep.py -d
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    Writing model with shapes after running onnx shape inference --  ../../../models/public/best_shape.onnx
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     1, Name : best                                              , Total time :     459.70, Offload Time :       0.00 , DDR RW MBs : 0, Output File : py_out_best_ADE_val_00001801.jpg

    py_out_best_ADE_val_00001801.jpg

    同样、我自己编译的 yolov5s6模型的输出也同样有效。

    py_out_yolov5s6_ADE_val_00001801.jpg

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Onnx 模型需要 Shape 推理- TIDL 才能正确编译它们。

    您的问题是否已解决?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    推理在 PC 上工作正常。 但是、如果我将文件夹复制到 EVM 并运行 repo 中提到的脚本、我会遇到错误。

    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    libtidl_onnxrt_EP loaded 0x2d61e220 
    
    ******** WARNING ******* : Could not open ../../../model-artifacts//best//allowedNode.txt for reading... Entire model will run on ARM without any delegation to TIDL !
    Final number of subgraphs created are : 1, - Offloaded Nodes - 0, Total Nodes - 0 
    
    ******** WARNING ******* : Could not open ../../../model-artifacts//best//allowedNode.txt for reading... Entire model will run on ARM without any delegation to TIDL !
    Final number of subgraphs created are : 1, - Offloaded Nodes - 0, Total Nodes - 0 
    
    ******** WARNING ******* : Could not open ../../../model-artifacts//best//allowedNode.txt for reading... Entire model will run on ARM without any delegation to TIDL !
    Final number of subgraphs created are : 1, - Offloaded Nodes - 0, Total Nodes - 65535 
    ./scripts/run_python_examples.sh: line 23:  3351 Killed                  python3 onnxrt_ep.py

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    如果我对预先训练的 yolov5s6模型执行相同的操作、我会得到不同的错误。

    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['yolov5s6']
    
    
    Running_Model :  yolov5s6  
    
    Traceback (most recent call last):
      File "onnxrt_ep.py", line 251, in <module>
        run_model(model, mIdx)
      File "onnxrt_ep.py", line 168, in run_model
        sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
      File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
        self._create_inference_session(providers, provider_options)
      File "/usr/lib/python3.8/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 /opt/edgeai-tidl-tools/model-artifacts/yolov5s6/model/yolov5s6.onnx failed:/usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/onnxruntime/core/graph/model.cc:101 onnxruntime::Model::Model(onnx::ModelProto&&, const PathString&, const IOnnxRuntimeOpSchemaRegistryList*, const onnxruntime::logging::Logger&) ModelProto does not have a graph.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,

    模型工件不会复制到预期路径。 在结束任何操作之前、 对于设置的完整性检查、您可以通过将模型还原到来运行 python 中的默认模型示例  

    型号=['cl-ort-resnet18-v1'、'cl-ort-caffe_semplet_v1_1'、's-ort-deeplabv3lite_mobilenetv2'、'od-ort-ssds-lite_mobilenetv2_fp"]

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    İşte orijinal sonuçlar。 Çıkarım sonuçları"output_images" klasörüne eklenmiş gibi görünüyor。

    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 10 alloc's of 18610376 bytes 
    MEM: Free's : 10 free's  of 18610376 bytes 
    MEM: Open's : 0 allocs  of 0 bytes 
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 4 Models - ['cl-ort-resnet18-v1', 'cl-ort-caffe_squeezenet_v1_1', 'ss-ort-deeplabv3lite_mobilenetv2', 'od-ort-ssd-lite_mobilenetv2_fpn']
    
    
    Running_Model :  cl-ort-resnet18-v1  
    
    2022-06-22 13:57:50.723167216 [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.
    2022-06-22 13:57:50.723244407 [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.
    2022-06-22 13:57:50.723301998 [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.
    2022-06-22 13:57:50.723323513 [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.
    2022-06-22 13:57:50.723345268 [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.
    2022-06-22 13:57:50.723362286 [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.
    2022-06-22 13:57:50.723379089 [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.
    2022-06-22 13:57:50.723396927 [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.
    2022-06-22 13:57:50.723414165 [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.
    2022-06-22 13:57:50.723432629 [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.
    2022-06-22 13:57:50.723450827 [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.
    2022-06-22 13:57:50.723469241 [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.
    2022-06-22 13:57:50.723486188 [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.
    2022-06-22 13:57:50.723505532 [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.
    2022-06-22 13:57:50.723523096 [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.
    2022-06-22 13:57:50.723540684 [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.
    2022-06-22 13:57:50.723562079 [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.
    2022-06-22 13:57:50.723582698 [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.
    2022-06-22 13:57:50.723603603 [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.
    2022-06-22 13:57:50.723622707 [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.
    libtidl_onnxrt_EP loaded 0x33a7c3c0 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 52, Total Nodes - 52 
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     11432.463707 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     11432.463787 s:  VX_ZONE_INIT:Enabled
     11432.463806 s:  VX_ZONE_ERROR:Enabled
     11432.463823 s:  VX_ZONE_WARNING:Enabled
     11432.464893 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
     11432.465145 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    
     ,  0  23.579361  warplane, military plane ,,  1  22.507572  aircraft carrier, carrier, flattop, attack aircraft carrier ,,  2  18.756310  projectile, missile ,,  3  18.488363  missile ,,  4  15.808890  airliner ,
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     1, Name : cl-ort-resnet18-v1                                , Total time :       2.41, Offload Time :       2.33 , DDR RW MBs : 0, Output File : py_out_cl-ort-resnet18-v1_airshow.jpg 
     
     
     11433.459357 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
     11433.462062 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 7 alloc's of 12769620 bytes 
    MEM: Free's : 7 free's  of 12769620 bytes 
    MEM: Open's : 0 allocs  of 0 bytes 
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    
    Running_Model :  cl-ort-caffe_squeezenet_v1_1  
    
    libtidl_onnxrt_EP loaded 0x33a7c3c0 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 68, Total Nodes - 68 
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     11433.527551 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     11433.527587 s:  VX_ZONE_INIT:Enabled
     11433.528162 s:  VX_ZONE_ERROR:Enabled
     11433.528758 s:  VX_ZONE_WARNING:Enabled
     11433.529373 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
     11433.529616 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    
     ,  0  0.516560  warplane, military plane ,,  1  0.319705  aircraft carrier, carrier, flattop, attack aircraft carrier ,,  2  0.108509  airliner ,,  3  0.022795  missile ,,  4  0.017946  projectile, missile ,
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     2, Name : cl-ort-caffe_squeezenet_v1_1                      , Total time :       1.16, Offload Time :       1.08 , DDR RW MBs : 0, Output File : py_out_cl-ort-caffe_squeezenet_v1_1_airshow.jpg 
     
     
     11434.332022 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
     11434.335435 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 7 alloc's of 2388592 bytes 
    MEM: Free's : 7 free's  of 2388592 bytes 
    MEM: Open's : 0 allocs  of 0 bytes 
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    
    Running_Model :  ss-ort-deeplabv3lite_mobilenetv2  
    
    libtidl_onnxrt_EP loaded 0x33a7c3c0 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 124, Total Nodes - 124 
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     11434.469180 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     11434.470050 s:  VX_ZONE_INIT:Enabled
     11434.470063 s:  VX_ZONE_ERROR:Enabled
     11434.470070 s:  VX_ZONE_WARNING:Enabled
     11434.470448 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
     11434.470515 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     3, Name : ss-ort-deeplabv3lite_mobilenetv2                  , Total time :      10.99, Offload Time :      10.85 , DDR RW MBs : 0, Output File : py_out_ss-ort-deeplabv3lite_mobilenetv2_ADE_val_00001801.jpg 
     
     
     11452.035294 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
     11452.038730 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 7 alloc's of 5321724 bytes 
    MEM: Free's : 7 free's  of 5321724 bytes 
    MEM: Open's : 0 allocs  of 0 bytes 
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    
    Running_Model :  od-ort-ssd-lite_mobilenetv2_fpn  
    
    libtidl_onnxrt_EP loaded 0x33a7c3c0 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 494, Total Nodes - 494 
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     11452.875865 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     11452.876499 s:  VX_ZONE_INIT:Enabled
     11452.876788 s:  VX_ZONE_ERROR:Enabled
     11452.877037 s:  VX_ZONE_WARNING:Enabled
     11452.877645 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
     11452.878139 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     4, Name : od-ort-ssd-lite_mobilenetv2_fpn                   , Total time :      11.99, Offload Time :      11.70 , DDR RW MBs : 0, Output File : py_out_od-ort-ssd-lite_mobilenetv2_fpn_ADE_val_00001801.jpg 
     
     
     11467.142170 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
     11467.146557 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 8 alloc's of 5527700 bytes 
    MEM: Free's : 8 free's  of 5527700 bytes 
    MEM: Open's : 0 allocs  of 0 bytes 
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    
    
    Running Inference on Model -  ../../../model-artifacts/cl-dlr-tflite_inceptionnetv3_device
    
    2022-06-22 13:58:26,334 ERROR error in DLRModel instantiation model_path ../../../model-artifacts/cl-dlr-tflite_inceptionnetv3_device doesn't exist
    Traceback (most recent call last):
      File "/usr/lib/python3.8/site-packages/dlr/api.py", line 89, in __init__
        self._impl = DLRModelImpl(model_path, dev_type, dev_id, error_log_file, use_default_dlr)
      File "/usr/lib/python3.8/site-packages/dlr/dlr_model.py", line 65, in __init__
        raise ValueError("model_path %s doesn't exist" % model_path)
    ValueError: model_path ../../../model-artifacts/cl-dlr-tflite_inceptionnetv3_device doesn't exist
    Traceback (most recent call last):
      File "dlr_inference_example.py", line 192, in <module>
        model_create_and_run(model_output_directory, 'input',
      File "dlr_inference_example.py", line 157, in model_create_and_run
        model = DLRModel(model_dir, 'cpu')
      File "/usr/lib/python3.8/site-packages/dlr/api.py", line 92, in __init__
        raise ex
      File "/usr/lib/python3.8/site-packages/dlr/api.py", line 89, in __init__
        self._impl = DLRModelImpl(model_path, dev_type, dev_id, error_log_file, use_default_dlr)
      File "/usr/lib/python3.8/site-packages/dlr/dlr_model.py", line 65, in __init__
        raise ValueError("model_path %s doesn't exist" % model_path)
    ValueError: model_path ../../../model-artifacts/cl-dlr-tflite_inceptionnetv3_device doesn't exist

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    谢谢。 看起来设置良好。  

    现在让我们找出错误:" 无法打开../../../model-artifes//best /allowedNode.TX"

    是否可以验证这些文件 是否存在:

    1)模型工件//BEST /allowedNode.txt

    2)模型存在于 models/public/best 形状.onnx 中

    另外、为了避免混淆、您可以在 /edgeeai-tidl-tools/examples/osrT_python common_utils.py 中更新字典

    “最佳”:{
    'model_path':os.path.join ('/home/sefau18/edgeeai-tidl-tools/models/public/best.onnx'),

    'model_path'os.path.join (models_base_path'best.onnx')
    'main':[0、0、0]、

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    这是我在进行您提到的更改后得到的错误。

    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    libtidl_onnxrt_EP loaded 0x39b3120 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 434, Total Nodes - 434 
    2022-06-23 06:37:14.949809627 [E:onnxruntime:, inference_session.cc:1310 operator()] Exception during initialization: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1
    
    Traceback (most recent call last):
      File "onnxrt_ep.py", line 251, in <module>
        run_model(model, mIdx)
      File "onnxrt_ep.py", line 168, in run_model
        sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
      File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
        self._create_inference_session(providers, provider_options)
      File "/usr/lib/python3.8/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: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,  

    您能否在没有委托模式的情况下运行模型。  通过运行 python3 onnxrt_ep.py -d.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Muhammed、
    如果我这么做、代码会冻结、不会给出任何结果。 然而、原始模型似乎没有问题。
    型号=['BEST "]

    root@j7-evm:/opt/edgeai-tidl-tools/examples/osrt_python/ort# python3 onnxrt_ep.py -d
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    

    型号=['cl-ort-resnet18-v1''cl-ort-caffe_semplet_v1_1''s-ort-deeplabv3lite_mobilenetv2''od-ort-ssds-lite_mobilenetv2_FPN']

    oot@j7-evm:/opt/edgeai-tidl-tools/examples/osrt_python/ort# python3 onnxrt_ep.py -d
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 4 Models - ['cl-ort-resnet18-v1', 'cl-ort-caffe_squeezenet_v1_1', 'ss-ort-deeplabv3lite_mobilenetv2', 'od-ort-ssd-lite_mobilenetv2_fpn']
    
    
    Running_Model :  cl-ort-resnet18-v1  
    
    2022-06-24 06:48:00.375196036 [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.
    2022-06-24 06:48:00.375263804 [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.
    2022-06-24 06:48:00.375909706 [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.
    2022-06-24 06:48:00.375963148 [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.
    2022-06-24 06:48:00.376396804 [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.
    2022-06-24 06:48:00.376982218 [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.
    2022-06-24 06:48:00.377027725 [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.
    2022-06-24 06:48:00.377247281 [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.
    2022-06-24 06:48:00.377464381 [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.
    2022-06-24 06:48:00.377673067 [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.
    2022-06-24 06:48:00.377883242 [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.
    2022-06-24 06:48:00.378252270 [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.
    2022-06-24 06:48:00.378544674 [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.
    2022-06-24 06:48:00.378951874 [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.
    2022-06-24 06:48:00.378998031 [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.
    2022-06-24 06:48:00.379209111 [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.
    2022-06-24 06:48:00.379431622 [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.
    2022-06-24 06:48:00.379679714 [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.
    2022-06-24 06:48:00.379716016 [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.
    2022-06-24 06:48:00.379738702 [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.
    
     ,  0  25.051779  warplane, military plane ,,  1  22.756052  aircraft carrier, carrier, flattop, attack aircraft carrier ,,  2  19.245899  projectile, missile ,,  3  19.136238  missile ,,  4  16.698288  wing ,
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     1, Name : cl-ort-resnet18-v1                                , Total time :     391.39, Offload Time :       0.00 , DDR RW MBs : 0, Output File : py_out_cl-ort-resnet18-v1_airshow.jpg 
     
     
    
    Running_Model :  cl-ort-caffe_squeezenet_v1_1  
    
    
     ,  0  0.627038  warplane, military plane ,,  1  0.209702  aircraft carrier, carrier, flattop, attack aircraft carrier ,,  2  0.055806  projectile, missile ,,  3  0.053149  airliner ,,  4  0.045723  missile ,
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     2, Name : cl-ort-caffe_squeezenet_v1_1                      , Total time :      97.00, Offload Time :       0.00 , DDR RW MBs : 0, Output File : py_out_cl-ort-caffe_squeezenet_v1_1_airshow.jpg 
     
     
    
    Running_Model :  ss-ort-deeplabv3lite_mobilenetv2  
    
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     3, Name : ss-ort-deeplabv3lite_mobilenetv2                  , Total time :    1888.53, Offload Time :       0.00 , DDR RW MBs : 0, Output File : py_out_ss-ort-deeplabv3lite_mobilenetv2_ADE_val_00001801.jpg 
     
     
    
    Running_Model :  od-ort-ssd-lite_mobilenetv2_fpn  
    
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     4, Name : od-ort-ssd-lite_mobilenetv2_fpn                   , Total time :    1050.49, Offload Time :       0.00 , DDR RW MBs : 0, Output File : py_out_od-ort-ssd-lite_mobilenetv2_fpn_ADE_val_00001801.jpg

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Beker、

    我们 已验证设置是否正常、并且此特定型号出现故障。 这主要是 由于内存不足。 是否可以在 PC 环境(x86)中运行相同的命令来验证模型?  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Muhammed、
    我已经在 x86环境中推断了这一点。 您可以检查我共享的交通标志的注释。 我认为我的问题是为模型工件创建文件夹。

    提前感谢您的帮助。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Beker、

    使用-c 选项运行 python 时将生成 model-artifers 文件夹、如上所述。

    从错误中看、它不像模型-工件文件夹放置错误问题。 我们可以尝试使用较小的教科书模型并执行相同的过程、以便缩小问题的范围。 ( 有关模型、请参阅 TI model zoo github.com/.../edgeai-modelzoo)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Muhammed、
    如果我对预先训练的 yolov5s6模型执行相同的操作、我会得到不同的错误。

    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['yolov5s6']
    
    
    Running_Model :  yolov5s6  
    
    Traceback (most recent call last):
      File "onnxrt_ep.py", line 251, in <module>
        run_model(model, mIdx)
      File "onnxrt_ep.py", line 168, in run_model
        sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provider_options=[delegate_options, {}], sess_options=so)
      File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
        self._create_inference_session(providers, provider_options)
      File "/usr/lib/python3.8/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 /opt/edgeai-tidl-tools/model-artifacts/yolov5s6/model/yolov5s6.onnx failed:/usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/onnxruntime/core/graph/model.cc:101 onnxruntime::Model::Model(onnx::ModelProto&&, const PathString&, const IOnnxRuntimeOpSchemaRegistryList*, const onnxruntime::logging::Logger&) ModelProto does not have a graph.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Muhammed、

    让我解释一下我们从一开始就分步执行的操作、以便我们能够更好地理解问题。

    我们有 EVM 套件、我共享了该套件的映像。 我们还有一个 GMSL 摄像头。 我们有一个用于 EVM 套件输出的屏幕。 我们使用 VS 代码通过 ssh 方法使用 Ubuntu 18.04通过 PC 连接到 EVM。  使用 EDGE_ai_apps、我们可以从摄像机获取图像并实时测试演示。

    步骤1.


    https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-SK-TDA4VM

    我们使用 Balena 通过 SD 卡的相关链接编写了我们下载的映像文件。


    步骤2.

    https://github.com/TexasInstruments/edgeai-yolov5

    我们使用我们的自定义数据和相关的报告对 yolov5模型进行培训。  同样、我们将使用相同的 REPO 进行 ONnx 模型转换。 现在、我们有两个文件。

    1-最好的。onnx

    2:best.prototxt


    步骤3.

    https://github.com/TexasInstruments/edgeai-tidl-tools

    我们使用 edgeeai-tidl-tools 存储库创建"best.onnx"和"best.prototxt"文件的 artifers 文件夹。

    sefau18@ubuntu:~/edgeai-tidl-tools/examples/osrt_python/ort$ python3 onnxrt_ep.py -c
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    Writing model with shapes after running onnx shape inference --  ../../../models/public/best_shape.onnx
    TIDL Meta PipeLine (Proto) File  : ../../../models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Number of OD backbone nodes = 0 
    Size of odBackboneNodeIds = 0 
    
    Preliminary subgraphs created = 0 
    Final number of subgraphs created are : 0, - Offloaded Nodes - 0, Total Nodes - 1 
    TIDL Meta PipeLine (Proto) File  : ../../../models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Number of OD backbone nodes = 0 
    Size of odBackboneNodeIds = 0 
    
    Preliminary subgraphs created = 0 
    Final number of subgraphs created are : 0, - Offloaded Nodes - 0, Total Nodes - 1 
    TIDL Meta PipeLine (Proto) File  : ../../../models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Number of OD backbone nodes = 328 
    Size of odBackboneNodeIds = 328 
    
    Preliminary subgraphs created = 1 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 434, Total Nodes - 434 
    TIDL Meta PipeLine (Proto) File  : ../../../models/public/best.prototxt  
    yolo_v3
    yolo_v3
    Warning : Requested Output Data Convert Layer is not Added to the network, It is currently not Optimal
    
     ************** Frame index 1 : Running float import ************* 
    INFORMATION: [TIDL_ResizeLayer] Resize_195 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_219 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_243 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    WARNING: [TIDL_E_DATAFLOW_INFO_NULL] ti_cnnperfsim.out fails to allocate memory in MSMC. Please look into perfsim log. This model can only be used on PC emulation, it will get fault on target.
    ****************************************************
    **          4 WARNINGS          0 ERRORS          **
    ****************************************************
     0.0s:  VX_ZONE_INIT:Enabled
     0.24s:  VX_ZONE_ERROR:Enabled
     0.26s:  VX_ZONE_WARNING:Enabled
     0.456s:  VX_ZONE_INIT:[tivxInit:178] Initialization Done !!!
    
    **********  Frame Index 1 : Running float inference **********
    
    **********  Frame Index 2 : Running fixed point mode for calibration **********
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   50800.94  .... ..... ... .... .....
    #    1 . .. T   50743.26  .... ..... ... .... .....
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   31451.69  .... ..... ... .... .....
    #    1 . .. T   31204.08  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 0 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   31393.10  .... ..... ... .... .....
    #    1 . .. T   31123.50  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 1 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   31272.20  .... ..... ... .... .....
    #    1 . .. T   32056.80  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 2 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   31252.65  .... ..... ... .... .....
    #    1 . .. T   31130.10  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 3 completed ************************ 
     
     
     
    
    ~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
    
    Processing config file #0 : /home/sefau18/edgeai-tidl-tools/model-artifacts/best/tempDir/tempDir/detections_tidl_io_.qunat_stats_config.txt 
     ----------------------- TIDL Process with REF_ONLY FLOW ------------------------
    
    #    0 . .. T   31182.16  .... ..... ... .... .....
    #    1 . .. T   31008.60  .... ..... ... .... .....
     
     
     *****************   Calibration iteration number 4 completed ************************ 
     
     
     
    
    ------------------ Network Compiler Traces -----------------------------
    successful Memory allocation
    substitute string tidl_net_ not found
    INFORMATION: [TIDL_ResizeLayer] Resize_195 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_219 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    INFORMATION: [TIDL_ResizeLayer] Resize_243 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
    ****************************************************
    **          3 WARNINGS          0 ERRORS          **
    ****************************************************
    
     
    Completed_Model :     1, Name : best                                              , Total time :  268678.36, Offload Time :   50674.55 , DDR RW MBs : 0, Output File : py_out_best_ADE_val_00001801.jpg 
    


    步骤4.

    我们可以提取推论到 x86环境。 模型按预期工作。

    sefau18@ubuntu:~/edgeai-tidl-tools/examples/osrt_python/ort$ python3 onnxrt_ep.py -d
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    Writing model with shapes after running onnx shape inference --  ../../../models/public/best_shape.onnx
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     1, Name : best                                              , Total time :     301.03, Offload Time :       0.00 , DDR RW MBs : 0, Output File : py_out_best_ADE_val_00001801.jpg 
    


    步骤5.

    我们在步骤3中创建的工件文件夹如下所示。

    sefau18@Ubuntu:~/edgeeai-tidl-tools/model-artifes/best$树

    sefau18@ubuntu:~/edgeai-tidl-tools/model-artifacts/best$ tree
    
     .
     ├── tempDir
     │   ├── detections_calib_raw_data.bin
     │   ├── detections_tidl_io_1.bin
     │   ├── detections_tidl_io__LayerPerChannelMean.bin
     │   ├── detections_tidl_io_.perf_sim_config.txt
     │   ├── detections_tidl_io_.qunat_stats_config.txt
     │   ├── detections_tidl_io__stats_tool_out.bin
     │   ├── detections_tidl_net
     │   │   ├── bufinfolog.csv
     │   │   ├── bufinfolog.txt
     │   │   └── perfSimInfo.bin
     │   ├── detections_tidl_net.bin
     │   ├── detections_tidl_net.bin.layer_info.txt
     │   ├── detections_tidl_net.bin_netLog.txt
     │   ├── detections_tidl_net.bin_paramDebug.csv
     │   ├── detections_tidl_net.bin.svg
     │   ├── graphvizInfo.txt
     │   └── runtimes_visualization.svg
     ├── allowedNode.txt
     ├── best.onnx
     ├── detections_tidl_io_1.bin
     ├── detections_tidl_net.bin
     ├── onnxrtMetaData.txt
     └── param.yaml
    
    2 directories, 22 files


    步骤6.

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/latest/exports/docs/inference_models.html

    我们手动创建上面链接中显示的工件文件夹。

    sefau18@ubuntu:~/edgeai-tidl-tools/model-artifacts/best-manual$ tree
    .
    ├── artifacts
    │   ├── allowedNode.txt
    │   ├── detections_tidl_io_1.bin
    │   ├── detections_tidl_net.bin
    │   ├── detections_tidl_net.bin_netLog.txt
    │   ├── detections_tidl_net.bin.svg
    │   ├── onnxrtMetaData.txt
    │   └── runtimes_visualization.svg
    ├── model
    │   ├── best.onnx
    │   └── best.prototxt
    └── param.yaml
    
    2 directories, 10 files


    步骤7.

    我们在 EVM 上安装了 edgeai_tidl-tools 存储库。  然后、我们将手动创建的工件文件夹复制到 EVM。

    root@j7-evm:/opt/edgeai-tidl-tools# export DEVICE=j7
    root@j7-evm:/opt/edgeai-tidl-tools# source ./setup.sh
    .
    .
    .
    inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Properties/AppManifest.xml  
    inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Properties/AssemblyInfo.cs  
    inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Properties/WMAppManifest.xml  
     creating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Resources/
    inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Resources/AppResources.Designer.cs  
    inflating: opencv-4.1.0/samples/wp8/OpenCVXaml/OpenCVXaml/Resources/AppResources.resx  
    inflating: opencv-4.1.0/samples/wp8/readme.txt  


    步骤8.

    examples/osrT_python common_utils.py 编辑

    models_configs = {
        # ONNX RT OOB Models
        'best' : {
            'model_path' : os.path.join(models_base_path, 'best.onnx'),
            'mean': [0, 0, 0],
            'std' : [0.003921568627,0.003921568627,0.003921568627],
            'num_images' : numImages,
            'num_classes': 36,
            'model_type': 'od',
            'od_type' : 'YoloV5',
            'framework' : '',
            'meta_layers_names_list' : os.path.join(models_base_path, 'best.prototxt'),
            'session_name' : 'onnxrt' ,
            'meta_arch_type' : 6
        },


    步骤9.

    examples/osrT_python /ort/onnx_ep.py 编辑

    型号=['BEST "]

    步骤10.

    我们可以在 EVM 上进行推论。 它的工作方式与 x86环境一样良好。

    root@j7-evm:/opt/edgeai-tidl-tools/examples/osrt_python/ort# python3 onnxrt_ep.py -d
    Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']
    
    Running 1 Models - ['best']
    
    
    Running_Model :  best  
    
    
    Saving image to  ../../../output_images/
    
     
    Completed_Model :     1, Name : best                                              , Total time :   12447.09, Offload Time :       0.00 , DDR RW MBs : 0, Output File : py_out_best_ADE_val_00001801.jpg 
     
     


    步骤11.

    在 EVM 中、我们手动将/op/model_zoo 文件夹复制到在步骤6中创建的"最佳"文件夹。

    object_detection.yAML 编辑

    title: "Object Detection Demo"
    log_level: 2
    inputs:
        input0:
            source: /dev/video2
            format: jpeg
            width: 1280
            height: 720
            framerate: 30
        input1:
            source: /opt/edge_ai_apps/data/videos/video_0000_h264.mp4
            format: h264_sw
            width: 1280
            height: 720
            framerate: 30
            loop: True
        input2:
            source: /opt/edge_ai_apps/data/images/%04d.jpg
            width: 1280
            height: 720
            index: 0
            framerate: 1
            loop: True
        input3:
            source: /dev/video18
            width: 1936
            height: 1100
            format: rggb12
            subdev-id: 2
            framerate: 30
            sen-id: imx390
            ldc: True
    models:
        model0:
            model_path: /opt/model_zoo/TVM-OD-5020-yolov3-mobv1-gluon-mxnet-416x416
            viz_threshold: 0.6
        model1:
            model_path: /opt/model_zoo/od-8130_onnxrt_coco_edgeai-yolov5_yolov5l6_640_ti_lite_47p1_65p6_onnx
            viz_threshold: 0.6
        model2:
            model_path: /opt/model_zoo/best
            viz_threshold: 0.6
    outputs:
        output0:
            sink: kmssink
            width: 1920
            height: 1080
        output1:
            sink: /opt/edge_ai_apps/data/output/videos/output_video.mkv
            width: 1920
            height: 1080
        output2:
            sink: /opt/edge_ai_apps/data/output/images/output_image_%04d.jpg
            width: 1920
            height: 1080
    
    flows:
        flow0:
            input: input3
            models: [model2]
            outputs: [output0]
            mosaic:
                mosaic0:
                    width:  1280
                    height: 720
                    pos_x:  320
                    pos_y:  180
    


    步骤12.

    我们正在 EVM 上运行 EDGE_ai_apps 实例。

    您可以看到我们得到的误差。

    root@j7-evm:/opt/edge_ai_apps/apps_python# ./app_edgeai.py ../configs/object_detection.yaml 
    Traceback (most recent call last):
      File "./app_edgeai.py", line 71, in <module>
        main(sys.argv)
      File "./app_edgeai.py", line 45, in main
        demo = EdgeAIDemo(config)
      File "/opt/edge_ai_apps/apps_python/edge_ai_class.py", line 74, in __init__
        model_obj = config_parser.Model(model_config)
      File "/opt/edge_ai_apps/apps_python/config_parser.py", line 104, in __init__
        self.mean = params['session']['input_mean']
    KeyError: 'input_mean'


    步骤13.

    这是原始 param.yaml 文件。

    postprocess:
      data_layout: NCHW
      detection_thr: 0.3
    preprocess:
      crop:
      - 640
      - 640
      data_layout: NCHW
      mean:
      - 0
      - 0
      - 0
      resize:
      - 640
      - 640
      scale:
      - 0.003921568627
      - 0.003921568627
      - 0.003921568627
    session:
      artifacts_folder: ''
      model_folder: model
      model_path: best.onnx
      session_name: onnxrt
    target_device: pc
    task_type: detection


    步骤14.

    然后、我们使用其他示例编辑 param.yAML 文件。

    postprocess:
      data_layout: NCHW
      detection_thr: 0.3
      formatter:
        dst_indices:
        - 4
        - 5
        name: DetectionBoxSL2BoxLS
        src_indices:
        - 5
        - 4
      ignore_index: null
      normalized_detections: false
      resize_with_pad: true
      save_output: false
      shuffle_indices: null
      squeeze_axis: null
    preprocess:
      crop:
      - 640
      - 640
      data_layout: NCHW
      mean:
      - 0
      - 0
      - 0
      resize:
      - 640
      - 640
      scale:
      - 0.003921568627
      - 0.003921568627
      - 0.003921568627
    
      add_flip_image: false
      backend: cv2
      interpolation: null
      pad_color:
      - 114
      - 114
      - 114
      resize_with_pad: true
      reverse_channels: false
    session:
      artifacts_folder: 'artifacts'
      dir_tree_depth: 3
      extra_inputs: null
      input_data_layout: NCHW
      input_mean: null
      input_optimization: true
      input_scale: null
      model_folder: model
      model_path: best.onnx
      session_name: onnxrt
    target_device: pc
    task_type: detection


    步骤15.

    这是我们在重试时得到的错误。

    root@j7-evm:/opt/edge_ai_apps/apps_python# ./app_edgeai.py ../configs/object_detection.yaml
    libtidl_onnxrt_EP loaded 0xdc00a70 
    Final number of subgraphs created are : 1, - Offloaded Nodes - 434, Total Nodes - 434 
    2022-07-06 12:51:44.042351690 [E:onnxruntime:, inference_session.cc:1310 operator()] Exception during initialization: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1
    
    Traceback (most recent call last):
      File "./app_edgeai.py", line 71, in <module>
        main(sys.argv)
      File "./app_edgeai.py", line 45, in main
        demo = EdgeAIDemo(config)
      File "/opt/edge_ai_apps/apps_python/edge_ai_class.py", line 74, in __init__
        model_obj = config_parser.Model(model_config)
      File "/opt/edge_ai_apps/apps_python/config_parser.py", line 136, in __init__
        self.run_time = RunTime(self)
      File "/opt/edge_ai_apps/apps_python/run_times.py", line 109, in __init__
        self.interpreter = onnxruntime.InferenceSession(params.model_path,\
      File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
        self._create_inference_session(providers, provider_options)
      File "/usr/lib/python3.8/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: /usr/src/debug/onnxruntime/1.7.0-r0_psdkla_4/git/include/onnxruntime/core/graph/graph.h:1299 onnxruntime::Node* onnxruntime::Graph::NodeAtIndexImpl(onnxruntime::NodeIndex) const node_index < nodes_.size() was false. Validating no unexpected access using an invalid node_index. Got:28271 Max:1

    此时、我们继续搜索解决方案。 我们怀疑这些是正确的步骤。 感谢您的提前帮助。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

     这个问题是否有任何想法?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    如果您启动的另一个线程 是 e2e.ti.com/.../4164033、那么让我们继续讨论