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.

Linux/AM5728: TensorFlow

Part Number: AM5728

Tool/software: Linux

Hello,

How can i install and use TensorFlow on the arago- linux i.e AM5728 evm.

Thanks and Regards,

Hiren Kumbhare

  • Hi Hiren,

    Can you please elaborate your requirement? What are you trying to do on AM57x? I would like to highlight that  AM57x device supports running only the inference side of Deep Learning and doesn't support training. Do you already have some network model developed using Tensor Flow?

    We have Processor SDK 5.0 release coming up (scheduled early next week) and will be packaged with TI Deep Learning solution. The release will have document on TIDL, that can help explain our offerings. 

    Regards,

    Manisha 

  • Hello Manisha,

    Thanks for your support.

    Our project requirement are face recognition using 4 ip cameras. We are currently working on the OpenCV 3.1. We are facing lots of issuses with opencv so wanted to try Tensorflow.

    Problems faced in OpenCV

    1) When we play rtsp stream directly using gstreamer (1080p resolution) it play correctly but when i just use the opencv api (even threading) the video lags a lot.

    2) If this is the case for the 1 IP  camera this is not gonna work for 4 Camera stream.

    If there is any solutions to this issue then we can use opencv only.

    How to use the hardware decoder to speedup the video processing in opencv?

    Thanks and Regards,

    Hiren Kumbhare

     

  • Hi, Hiren,

    For accelerated Codec encoding/decoding, TI provides the solution through GStreamer which enables hardware accelerator, bug OpenCV does not.

    For multimedia processing, please refer to software-dl.ti.com/.../Foundational_Components.html

    For OpenCV, please refer to software-dl.ti.com/.../Foundational_Components.html for more info on OpenCV.

    Rex
  • Hello Rex,

    Thanks for our valuable reply.

    Does this means Video will lag when using the OpenCV as it do not use hardware accelerated encoding/ decoding.

    Is there any way to solve this bug?

    Thanks and Regards,
    Hiren Kumbhare
  • Hi, Hiren,

    OpenCV should be using GStreamer underneath (opencv api-s), hence similar performance (to Gstreamer).
    Is this about decoding H264 (I assume) streams?

    Rex
  • Hiren,

    Could you also provide code snippet to show how the decode is done in OpenCV?

    Rex
  • Hello Rex,

              Actually, we are working with together. Please, check the code in attached file.

    Regards,

    Kishan Patel.g_opencv.cpp

  • Hi, Kishan,

    In the source file (g_opencv.cpp), it has GStreamer based capture (of RTSP stream) and decode.
    The original problem you have is that you were trying some equivalent in OpenCV, but that part is not in the code snippet.

    If you are trying to use GStreamer pipeline string as input argument for OpenCV capture constructor, there was similar issue raised earlier in e2e thread wrt OpenCV 3.1 baseline and is resolved. Please refer to e2e.ti.com/.../657015

    Rex
  • Hi, Kishan,

    There are some web posts with respect to Video Capture (not sure if problem observed is 3.1 only, and got resolved later in e.g. 3.3 or 3.4).

    github.com/.../8005
    stackoverflow.com/.../gstreamer-pipeline-in-opencv-videocapture
    devtalk.nvidia.com/.../

    Rex
  • Hello Rex,
    Thanks for reply.
    I have checked thread "e2e.ti.com/.../657015". In last, i can see that there is requirement to install some package as below:
    "MACHINE=am57xx-evm bitbake omapdrmtest --force -c compile".

    What is the actual use of this package means it will useful for gstreamer and opencv?
    And if yes, then what should i do in next?


    I have also checked above 3 threads.

    In 1st thread,this issue not occur for me means its working fine.
    The api which has discussed in others thread, its not working.

    Regards,
    Kishan Patel.
  • Hi, Kishan,

    omapdrmtest is a user space test utility which is not needed for gstreamer pipeline.

    Rex
  • Hello Rex,

    Thanks for your valuable time.

    But we are not clear about the solution.

    As Margarita suggested to bitbake "omapdrmtest" we did that and facing some error. Mentioning the Error below.

    As per you it is not needed, then what we need to do to solve this issue please guide us.

    We have also tried to use the direct OpenCV   "Videocapture cap" to use rtsp stream.

    Bitbake error:

    MACHINE=am57xx-evm bitbake omapdrmtest --force -c compile
    Loading cache: 100% |###########################################################################################################| Time: 0:00:01
    Loaded 4043 entries from dependency cache.
    Parsing recipes: 100% |#########################################################################################################| Time: 0:00:11
    Parsing of 3137 .bb files complete (3134 cached, 3 parsed). 4046 targets, 439 skipped, 0 masked, 0 errors.
    WARNING: No recipes available for:
      /home/hiren/Facial/tisdk/sources/meta-arago/meta-arago-distro/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bbappend
      /home/hiren/Facial/tisdk/sources/meta-processor-sdk/recipes-devtools/python/python3-native_3.5.2.bbappend
      /home/hiren/Facial/tisdk/sources/meta-processor-sdk/recipes-graphics/wayland/weston_1.11.0.bbappend
    NOTE: Resolving any missing task queue dependencies

    Build Configuration:
    BB_VERSION           = "1.36.0"
    BUILD_SYS            = "x86_64-linux"
    NATIVELSBSTRING      = "ubuntu-16.04"
    TARGET_SYS           = "arm-linux-gnueabi"
    MACHINE              = "am57xx-evm"
    DISTRO               = "arago"
    DISTRO_VERSION       = "2018.04"
    TUNE_FEATURES        = "arm armv7a vfp thumb neon callconvention-hard"
    TARGET_FPU           = "hard"
    meta-processor-sdk   = "HEAD:264dc66c689e0e4212c43358382986ee470619d4"
    meta-ros             = "HEAD:e2566402ab108a19634354a934788109422cf409"
    meta-arago-distro    
    meta-arago-extras    = "HEAD:d54e9d6c1d461dbf3189e691088d328bf4c4fb19"
    meta-browser         = "HEAD:26d50665e2f7223c5f4ad7481a8d2431e7cb55fb"
    meta-qt5             = "HEAD:682ad61c071a9710e9f9d8a32ab1b5f3c14953d1"
    meta-networking      
    meta-python          
    meta-oe              
    meta-gnome           
    meta-multimedia      = "HEAD:352531015014d1957d6444d114f4451e241c4d23"
    meta-ti              = "HEAD:8555084679dc5c668e5fb60a16425ca32b10ff21"
    meta-linaro-toolchain
    meta-optee           = "HEAD:75dfb67bbb14a70cd47afda9726e2e1c76731885"
    meta                 = "HEAD:931a52e8698f684ccbb26ddec18764ad9d9a3e8f"

    NOTE: Tainting hash to force rebuild of task /home/hiren/Facial/tisdk/sources/meta-arago/meta-arago-extras/recipes-graphics/omapdrmtest/omapdrmtest_1.0.0.bb, do_compile
    WARNING: /home/hiren/Facial/tisdk/sources/meta-arago/meta-arago-extras/recipes-graphics/omapdrmtest/omapdrmtest_1.0.0.bb.do_compile is tainted from a forced run
    Initialising tasks: 100% |######################################################################################################| Time: 0:00:03
    NOTE: Executing SetScene Tasks
    NOTE: Executing RunQueue Tasks
    WARNING: bc-native-1.06-r3 do_fetch: Failed to fetch URL ftp.gnu.org/.../bc-1.06.tar.gz, attempting MIRRORS if available
    WARNING: gperf-native-3.1-r0 do_fetch: Failed to fetch URL ftp.gnu.org/.../gperf-3.1.tar.gz, attempting MIRRORS if available
    WARNING: libpng-native-1.6.31-r0 do_fetch: Failed to fetch URL downloads.sourceforge.net/.../libpng-1.6.31.tar.xz, attempting MIRRORS if available
    WARNING: libogg-1.3.2-r0 do_fetch: Checksum mismatch for local file /home/hiren/Facial/tisdk/downloads/libogg-1.3.2.tar.xz
    Cleaning and trying again.
    WARNING: libogg-1.3.2-r0 do_fetch: Renaming /home/hiren/Facial/tisdk/downloads/libogg-1.3.2.tar.xz to /home/hiren/Facial/tisdk/downloads/libogg-1.3.2.tar.xz_bad-checksum_5429e1811b045912a85cf29761b57fb3
    WARNING: libogg-1.3.2-r0 do_fetch: Checksum failure encountered with download of downloads.xiph.org/.../libogg-1.3.2.tar.xz - will attempt other sources if available
    ERROR: linux-ti-staging-4.14.40+gitAUTOINC+4796173fc5-r7a.arago5.tisdk0.1 do_create_srcipk: Function failed: do_create_srcipk (log file is located at /home/hiren/Facial/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/linux-ti-staging/4.14.40+gitAUTOINC+4796173fc5-r7a.arago5.tisdk0.1/temp/log.do_create_srcipk.10040)
    ERROR: Logfile of failure stored in: /home/hiren/Facial/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/linux-ti-staging/4.14.40+gitAUTOINC+4796173fc5-r7a.arago5.tisdk0.1/temp/log.do_create_srcipk.10040
    Log data follows:
    | DEBUG: Executing python function sstate_task_prefunc
    | DEBUG: Python function sstate_task_prefunc finished
    | DEBUG: Executing shell function do_create_srcipk
    | Cloning into '/home/hiren/Facial/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/linux-ti-staging/4.14.40+gitAUTOINC+4796173fc5-r7a.arago5.tisdk0.1/temp-git-shallow-clone'...
    | error: --shallow-file died of signal 9
    | error: git upload-pack: git-pack-objects died with error.
    | fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
    | remote: aborting due to possible repository corruption on the remote side.
    | fatal: early EOF
    | fatal: index-pack failed
    | WARNING: /home/hiren/Facial/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/linux-ti-staging/4.14.40+gitAUTOINC+4796173fc5-r7a.arago5.tisdk0.1/temp/run.do_create_srcipk.10040:1 exit 128 from 'git clone --depth 400 --branch processor-sdk-linux-4.14.y file://$PWD/.git $gitshallowclone'
    | ERROR: Function failed: do_create_srcipk (log file is located at /home/hiren/Facial/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/linux-ti-staging/4.14.40+gitAUTOINC+4796173fc5-r7a.arago5.tisdk0.1/temp/log.do_create_srcipk.10040)
    ERROR: Task (/home/hiren/Facial/tisdk/sources/meta-ti/recipes-kernel/linux/linux-ti-staging_4.14.bb:do_create_srcipk) failed with exit code '1'
    NOTE: Tasks Summary: Attempted 930 tasks of which 355 didn't need to be rerun and 1 failed.

    Summary: 1 task failed:
      /home/hiren/Facial/tisdk/sources/meta-ti/recipes-kernel/linux/linux-ti-staging_4.14.bb:do_create_srcipk
    Summary: There were 8 WARNING messages shown.
    Summary: There was 1 ERROR message shown, returning a non-zero exit code.
     

    Thanks and Regards,

    Hiren Kumbhare

  • Hi, Hiren,

    I am not sure under what context the omapdrmtest was given. As I said, omapdrmtest is a user space test utility developed and used by other TI business unit (automotive). It is totally irrelevant to OpenCV. If you have question on this omapdrmtest, please open a thread for Automotive.

    I mentioned that OpenCV should be using GStreamer underneath, and hence similar performance to GStreamer.
    OpenCV->GST interface is pretty straightforward. In the other e2e thread, it provided the example url for this interface but it is for video writer, stackoverflow.com/.../how-to-open-a-gstreamer-pipeline-from-opencv-with-videowriter For video capture as input, that is the 2nd url I had in my previous post. The 3rd link has more info on OpenCV->GSTreamer video capture.

    What we have seen and are inclined to think that OpenCV baseline has the problem with GST appsink handling (used as entry point from GST to OpenCV). This is the first url I provided in earlier post. We aren’t sure if it is fixed in later OpenCV versions.

    Hope this post explains things better to clear the confusion you have, and the instruction on OpenCV using GStreamer pipeline is clear too.

    Rex
  • Hello Rex,

    We have already tried the link which u have mentioned for the videocapture but it is not working. It works with "gst-launch-1.0" but not working when used with "videocapture cap". Below is the pipeline which i m using and not working :

    VideoCapture cap("rtspsrc location=rtsp://admin:jenex#2018@192.168.1.108:554 latency=0 ! application/x-rtp,payload=96 ! rtph264depay ! h264parse ! ducatih264dec ! appsink sync=false", CAP_GSTREAMER);

    It is working with below gst-launch:

    gst-launch-1.0 rtspsrc location=rtsp://admin:jenex#2018@192.168.1.108:554 latency=0 ! application/x-rtp,payload=96 ! rtph264depay ! h264parse ! ducatih264dec ! waylandsink sync=false

    Thanks and Regards,
    Hiren Kumbhare