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: Getting error while running the commands from edgeai-tidl-tools documentation

Part Number: TDA4VM

Tool/software:

Hi,

I am referring "github.com/.../edgeai-tidl-tools do the emulation of TDA4VM using edgeai-tidl-tools.

I have successfully installed docker and pulled the necessary dependencies. Also built one python virtual environment inside the docker. The entire process executes without any error and warnings. I have followed the steps given in documentation to do the complete set-up of docker.

But, when I am trying to execute the code for quantize and compile the demo models using the below given commands, I am getting the following error. 

command ==>

mkdir build && cd build
cmake ../examples && make -j2 && cd ..
source ./scripts/run_python_examples.sh -o
python3 ./scripts/gen_test_report.py

error ==>


-- Compiling for x86 with am68pa config
-- Configuring done
-- Generating done
-- Build files have been written to: /u/root/build
[ 6%] Building CXX object osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o
[ 6%] Building CXX object osrt_cpp/pre_process/CMakeFiles/pre_process.dir/pre_process.cpp.o
In file included from /u/root/examples/osrt_cpp/post_process/post_process.cpp:64:
/u/root/examples/osrt_cpp/post_process/post_process.h:77:10: fatal error: tensorflow/lite/kernels/register.h: No such file or directory
77 | #include <tensorflow/lite/kernels/register.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [osrt_cpp/post_process/CMakeFiles/post_process.dir/build.make:76: osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:278: osrt_cpp/post_process/CMakeFiles/post_process.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 10%] Linking CXX static library /u/root/lib/Release/libpre_process.a
[ 10%] Built target pre_process
make: *** [Makefile:136: all] Error 2
bash: ./scripts/run_python_examples.sh: No such file or directory
python3: can't open file '/u/root/build/./scripts/gen_test_report.py': [Errno 2] No such file or directory

Kindly help me to rectify the issue.

Warm Regards

Vishnu

  • Hi Vishnu,

    Which TIDL tools version are you using? You are doing this in Docker as well, correct?  

    Whenever I build, I always run each command separately as there has been multiple moments when running them all together won't work for me. I recommend running each command, such as the cmake ../examples , then the make -j2 

    Also if the make-j2 causes issues, try with only make 

    Warm regards,

    Christina

  • Hi Christina,

    I am using 11_00_06_00 version for TIDL. I am doing the emulation inside docker container.

    I have done the above specified commands one after another, but getting the same error.

    Initially, I got an error specifying that opencv is not present. The error is pasted below ==>


    [ 6%] Building CXX object osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o
    /u/root/examples/osrt_cpp/pre_process/pre_process.cpp:67:10: fatal error: opencv2/core/core.hpp: No such file or directory
    67 | #include <opencv2/core/core.hpp>
    | ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make[2]: *** [osrt_cpp/pre_process/CMakeFiles/pre_process.dir/build.make:76: osrt_cpp/pre_process/CMakeFiles/pre_process.dir/pre_process.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:304: osrt_cpp/pre_process/CMakeFiles/pre_process.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    In file included from /u/root/examples/osrt_cpp/post_process/post_process.cpp:64:
    /u/root/examples/osrt_cpp/post_process/post_process.h:73:10: fatal error: opencv2/core/core.hpp: No such file or directory
    73 | #include <opencv2/core/core.hpp>
    | ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make[2]: *** [osrt_cpp/post_process/CMakeFiles/post_process.dir/build.make:76: osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:278: osrt_cpp/post_process/CMakeFiles/post_process.dir/all] Error 2
    make: *** [Makefile:136: all] Error 2
    (docker_env) root@71a357c6a1ed:/u/root/build# make
    [ 3%] Building CXX object osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o
    In file included from /u/root/examples/osrt_cpp/post_process/post_process.cpp:64:
    /u/root/examples/osrt_cpp/post_process/post_process.h:73:10: fatal error: opencv2/core/core.hpp: No such file or directory
    73 | #include <opencv2/core/core.hpp>
    | ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make[2]: *** [osrt_cpp/post_process/CMakeFiles/post_process.dir/build.make:76: osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:278: osrt_cpp/post_process/CMakeFiles/post_process.dir/all] Error 2
    make: *** [Makefile:136: all] Error 2

    So, I tried to install the opencv development headers from ubuntu package using the following command ==>

                                 apt-get update && apt-get install -y libopencv-dev

    After the successfull execution of the above command, I have deleted the build directory and start executing the commands from beginning. Now, opencv issue is resolved and I am getting the tensorflow-lite error which I have shown in my first query. 

    So from my understanding, the issue is the docker container doesn't contain the necessary files of opencv, tensorflow-lite, onnx and NeoAI-DLR. How can i solve this issue.

    Warm Regards,

    Vishnu

  • Hi Vishnu, 

    I am working on trying to replicate to see what may be causing this. Just to double check on your docker setup, did you do all of these steps found under the Docker setup, including the setup.sh script?  

    user@pc:~$ git clone github.com/.../edgeai-tidl-tools.git
    user@pc:~/edgeai-tidl-tools$ cd edgeai-tidl-tools
    user@pc:~/edgeai-tidl-tools$ git checkout <TAG Compatible with your SDK version>

     user@pc:~/edgeai-tidl-tools$ source ./scripts/docker/setup_docker.sh

    user@pc:~/edgeai-tidl-tools$ export REPO_LOCATION=artifactory.itg.ti.com/docker-public/library/ {blank if none}
    user@pc:~/edgeai-tidl-tools$ export PROXY=http://webproxy.ext.ti.com:80 {blank if no proxy}
    user@pc:~/edgeai-tidl-tools$ source ./scripts/docker/build_docker.sh

    user@pc:~/edgeai-tidl-tools$ source ./scripts/docker/run_docker.sh

    root@container:/home/root$ export SOC=<Your SOC name>
    root@container:/home/root$ export TIDL_TOOLS_TYPE=<Your Tools Type (CPU|GPU)>
    root@container:/home/root$ source ./setup.sh

    The last part, the setup.sh needs to be completed. I wasn't sure if you were able to run this or not based off of the steps you shared.

    Warm regards,

    Christina

  • Hi Christina,

    I have fully followed the docker setup steps specified in the edgeai-tidl-tools documentation.  Every commands executed successfully without any error or warnings. In addition I have used python virtual environment inside docker to eliminate the warnings which will come when executing setup.sh script. 

    Warm Regards,

    Vishnu

  • Could you share the errors you get when running setup.sh that required you to use python virtual environment to fix? The setup.sh script should run in docker without the need of anything else. 

    Additionally, after the setup.sh script completes, there should be a directory called tools in the edgeai-tidl-tools directory (home), that should have opencv, tensorflow-lite, onnx and dlr dependencies

    Warm regards,

    Christina

  • Hi Christina,

    I once again tried the entire steps from starting till source ./setup.sh. The setup.sh script executed without any error, but I found that several dependencies failed to install, because the required tar file is not found in my directory. I am pasting the relevant output of setup.sh below ==>


    chmod: cannot access 'ti_cgt_c7000_5.0.0.LTS_linux-x64_installer.bin': No such file or directory
    bash: ./ti_cgt_c7000_5.0.0.LTS_linux-x64_installer.bin: No such file or directory
    Installing:onnxruntime
    tar: onnx_1.15.0_x86_u22.tar.gz: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    bash: cd: onnx_1.15.0_x86_u22: No such file or directory
    rm: cannot remove 'onnx_1.15.0_x86_u22.tar.gz': No such file or directory
    Installing:tflite_2.12
    tar: tflite_2.12_x86_u22.tar.gz: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    rm: cannot remove 'tflite_2.12_x86_u22.tar.gz': No such file or directory
    Installing:opencv
    tar: opencv_4.2.0_x86_u22.tar.gz: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    rm: cannot remove 'opencv_4.2.0_x86_u22.tar.gz': No such file or directory
    Installing:dlr
    tar: dlr_1.10.0_x86_u22.tar.gz: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    rm: cannot remove 'dlr_1.10.0_x86_u22.tar.gz': No such file or directory
    =========================================================================
    SOC=am68pa
    TIDL_TOOLS_PATH=/home/root/tools/AM68PA
    LD_LIBRARY_PATH=:/home/root/tools/AM68PA:/home/root/tools/osrt_deps:/home/root/tools/osrt_deps/opencv_4.2.0_x86_u22/opencv/
    CGT7X_ROOT=/home/root/tools/ti-cgt-c7000_5.0.0.LTS
    ARM64_GCC_PATH=/home/root/tools/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu

     

    So, I prompted the same thing to chatgpt and it's saying me to download manually following tar files from TI's repo and paste it in the corresponding folder inside the docker container. Those tar files I want to download are ==>

    • ti_cgt_c7000_5.0.0.LTS_linux-x64_installer.bin

    • onnx_1.15.0_x86_u22.tar.gz

    • tflite_2.12_x86_u22.tar.gz

    • opencv_4.2.0_x86_u22.tar.gz

    • dlr_1.10.0_x86_u22.tar.gz


    How can I get those files ? Why files are missing while running setup.sh ?

    Warm Regards,

    Vishnu

  • Hi Vishnu,

    I am not sure why you are not able to run the setup.sh script entirely, as I am able to run it to completion and have the necessary files created. Do you have the necessary permissions on your PC?

    Alternatively, you can go directly into the setup.sh and get the links needed, which for your convenience I have placed below.

    https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-707zYe3Rik/5.0.0.LTS/ti_cgt_c7000_5.0.0.LTS_linux-x64_installer.bin

    https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/X86_64_LINUX/UBUNTU_22_04/onnx_1.15.0_x86_u22.tar.gz

    https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/X86_64_LINUX/UBUNTU_22_04/tflite_2.12_x86_u22.tar.gz

    https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/X86_64_LINUX/UBUNTU_22_04/opencv_4.2.0_x86_u22.tar.gz

    https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/X86_64_LINUX/UBUNTU_22_04/dlr_1.10.0_x86_u22.tar.gz

    Let me know if you have any questions. These should be placed in /home/root/tools/osrt_deps/ 

    Warm regards,

    Christina

  • Hi Christina,

    I followed the steps which you specified above and everything is executing well without any fail. Thanks for your support.

    Also I have a SSD_320_320.tflite model which takes an image of size 320 x 320 as input and recognize objects among the 80 classes of COCO dataset.

    I want to quantize, calibrate and compile this model for TDA4VM. Can you please guide me how can I achieve this.

    Warm Regards

    Vishnu

  • Hi Vishnu,

    Glad you were able to get everything to run!

    Please create a new E2e thread for this new question. We like to keep each E2e related to only one topic so it can be reference by others easier.

    Warm regards,

    Christina