<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by DL Builder on Medium]]></title>
        <description><![CDATA[Stories by DL Builder on Medium]]></description>
        <link>https://medium.com/@dlbuilder?source=rss-1b7589c60566------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*blHPr9ESIQ_ZC9-gvQ1Wng.png</url>
            <title>Stories by DL Builder on Medium</title>
            <link>https://medium.com/@dlbuilder?source=rss-1b7589c60566------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:31:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dlbuilder/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deep Learnig C++ Inference on Jetson Nano (3)]]></title>
            <link>https://dlbuilder.medium.com/deep-learnig-c-inference-on-jetson-nano-3-dcc5d6d7573?source=rss-1b7589c60566------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcc5d6d7573</guid>
            <category><![CDATA[jetson-multimedia-api]]></category>
            <category><![CDATA[yolov3-tiny]]></category>
            <category><![CDATA[jetson-nano]]></category>
            <category><![CDATA[tensorrt]]></category>
            <category><![CDATA[yolov3]]></category>
            <dc:creator><![CDATA[DL Builder]]></dc:creator>
            <pubDate>Sun, 08 Nov 2020 10:26:18 GMT</pubDate>
            <atom:updated>2020-11-08T10:26:18.048Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to inference yolov3 tiny (trained with CoCo Dataset) on jetson nano with tensorrt, webcam and jetson multimedia api (End to end fps is &gt; 25 for FullHD(1920x1080) camera)</h4><p>In this blog, we will make a C++ application that inferences a yolov3 tiny model trained with CoCo Dataset on Jetson Nano.</p><p>We will inference image from Webcam with tensorrt and jetson multimedia api.</p><p>The application is highly optimized and runs with real time(&gt;25fps, not just for inference frame rate, but for end-to-end frame rate) on Jetson Nano with FullHD camera.</p><h3>Prerequisite</h3><ul><li>Jetson Nano with Jetpack 4.4</li><li>USB webcam with Full HD (1920x1080) resolution</li></ul><h3>How to Run</h3><ul><li>Download dependencies from this page (<a href="https://dlbuilder.ai/#/dependencies">https://dlbuilder.ai/#/dependencies</a>), download jetson 4.4 dependencies, unzip and run the shell inside it.<br>This shell sets cuda path and installs some dependencies.</li><li>Go the github page (<a href="https://github.com/dlbuilder/yolov3-tiny-on-jetson-nano">https://github.com/dlbuilder/yolov3-tiny-on-jetson-nano</a>) and clone the repository</li></ul><pre>git clone <a href="https://github.com/dlbuilder/yolov3-tiny-on-jetson-nano.git">https://github.com/dlbuilder/yolov3-tiny-on-jetson-nano.git</a></pre><ul><li>Download TensorRT Engine File from this link</li></ul><p><a href="https://drive.google.com/file/d/1neAqvlXuK23qHCyIwetF1zzMXRpS3gSg/view?usp=sharing">TinyYolov3_coco_jetsonnano4.4_sm53_tensorrt7.1_fp16.engine</a></p><ul><li>Put the download file at Models directory in above cloned repository.</li></ul><p>We refer to the following github repository(<a href="https://github.com/wang-xinyu/tensorrtx/tree/master/yolov3-tiny">https://github.com/wang-xinyu/tensorrtx/tree/master/yolov3-tiny</a>) to make TensorRT Engine file from yolov3 tiny weight (<a href="https://pjreddie.com/media/files/yolov3-tiny.weights">https://pjreddie.com/media/files/yolov3-tiny.weights</a>) file. It is darknet weight trained with CoCo dataset.</p><p>TensorRT Engine file is not portable between devices, if you want to run the model on other device, not on jetson nano, you must make the tensorrt engine file on that device again.</p><p>And, if you have your own custom trained weight file, you must also make tensorrt engine file again.</p><ul><li>Build and run the source. Move to the github source directory you cloned.</li></ul><pre>mkdir build</pre><pre>cd build</pre><pre>cmake ..</pre><pre>make -j4</pre><pre>./JetsonDetection</pre><h3>Notes</h3><ul><li>If you don’t have FullHD webcam</li></ul><p>→Open DataPool.h file, and modify imageWidth, imageHeight to the resolution that you want. (default is imageWidth=1920, imageHeight=1080)</p><ul><li>If you want to run your own custom model or on another jetson device</li></ul><p>→ you must make tensorrt engine file according to the guide of this repository (<a href="https://github.com/wang-xinyu/tensorrtx/tree/master/yolov3-tiny">https://github.com/wang-xinyu/tensorrtx/tree/master/yolov3-tiny</a>)</p><p>→ Open TinyYolov3Layer.h, and modify the CLASS_NUM value according to your dataset. (default is CLASS_NUM=80, becuase class num of CoCo dataset is 80)<br> → Modify model file name in DataPool.h file if you make your own engine file (default is ./Models/TinyYolov3_coco_jetsonnano4.4_sm53_tensorrt7.1_fp16.engine)</p><ul><li>If you have any problem or question, you could send me the email (<a href="/service/mailto:dlbuilder2020@gmail.com">dlbuilder2020@gmail.com</a>)</li></ul><h3>Explanation of the Source</h3><ul><li>The application uses Jetson Multimedia API (<a href="https://dlbuilder.medium.com/tensorflow-2-c-build-and-inference-on-jetson-nano-2-6e0236c97249">Refer to my last blog about Jetson Multimedia API</a>) for high performance (v4l2, nvjpeg, cuda interop, eglrenderer)</li><li>The application is composed of Filters(the component to make the application), and each Filter is chained to do the inference.</li><li>The Filters we use in this application is located in Filters directory</li><li>The role of each filter is</li></ul><ol><li>WebcamJetsonFilter : Read Webcam image in MJPEG format (v4l2) and decode the image (using v4l2, nvjpeg)</li><li>TinyYolov3PreProcessingJetsonFilter : Resize and Normalize webcam image from WebcamJetsonFilter in GPU to feed it to inference (using multimedia api and cuda interop)</li><li>TensorRTInferenceFilter : Parse the tensorrt engine file, and get preprocessed image from TinyYolov3PreProcessingJetsonFilter, and inference the model (using tensorrt)</li><li>TensorRTTinyYolov3PostProcessingFilter : Handle inference result from TensorRTInferenceFilter to get the wanted format</li><li>TinyYolov3NonMaximumSuppressionFilter : Filter to do NonMaximumSuppression from the TensorRTTinyYolov3PostProcessingFilter result</li><li>DetectionEGLRenderFilter : Render the camera image (from WebcamJetsonFilter) with detection result (from TinyYolov3NonMaximumSuppressionFilter) (using eglrenderer)</li></ol><ul><li>All configurations (such as camera input size, model input size, detection threshold, nmsthresold etc) are located in DataPool.h</li></ul><p><strong><em>If you are interested in deep learning inference in c++, feel free to visit </em></strong><a href="https://dlbuilder.ai/"><strong><em>https://dlbuilder.ai</em></strong></a><strong><em> (Train once, Inference anywhere)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcc5d6d7573" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tensorflow 2 C++ Build and Inference on Jetson Nano (2)]]></title>
            <link>https://dlbuilder.medium.com/tensorflow-2-c-build-and-inference-on-jetson-nano-2-6e0236c97249?source=rss-1b7589c60566------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e0236c97249</guid>
            <category><![CDATA[tensorflow-cpp]]></category>
            <category><![CDATA[tensorflow-2-cpp]]></category>
            <category><![CDATA[jetson-nano]]></category>
            <category><![CDATA[tensorflow2-cpp]]></category>
            <category><![CDATA[jetson-multimedia-api]]></category>
            <dc:creator><![CDATA[DL Builder]]></dc:creator>
            <pubDate>Sun, 18 Oct 2020 13:06:26 GMT</pubDate>
            <atom:updated>2020-11-08T06:58:34.569Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deep Learnig C++ Inference on Jetson Nano (2)</h3><h4><em>Jetson Linux Multimedia API</em></h4><p><em>In the </em><a href="https://dlbuilder.medium.com/tensorflow-2-3-1-c-build-and-inference-on-jetson-nano-1-b04fdb442cc9"><em>last blog</em></a><em>, we shared how to build Tensorflow 2.3.1 on Jetson and the pre-built results.<br>In this blog, I would like to introduce a method that can achieve good performance in preprocessing, postprocessing, and rendering, which are essential for inference of deep learning models.<br>Most internet resources use OpenCV a lot in an easy way.<br>However, Jetson includes the high-performance Jetson Linux Multimedia API.<br>When I did the actual implementation, I could see that the method using the Jetson Linux Multimedia API performs much better.<br>This time, the example </em><a href="https://docs.nvidia.com/jetson/l4t-multimedia/l4t_mm_v4l2_cam_cuda_group.html"><em>12_camera_v4l2_cuda</em></a><em> of Jetson Linux Multimedia API is modified to receive the webcam video, do AlphaBlending effect and display it on the screen.<br>For more details on the Jetson Linux Multimedia API, please refer to the following link.</em></p><p><a href="https://docs.nvidia.com/jetson/l4t-multimedia/index.html">Jetson Linux Multimedia API Reference: Main Page</a></p><h3>1. Webcam Anylysis</h3><ul><li>Webcam connection (I use a Logitech C920 model)</li><li>Install v4l-utils</li></ul><pre>sudo apt-get install v4l-utils</pre><ul><li>Viewing Webcam information</li></ul><pre>v4l2-ctl --list-formats-ex</pre><ul><li>Before executing the example, it is necessary to decide in which format the input will be received.</li><li>If you execute the above command, you can check the pixel format, resolution, and frame rate information that the camera supports.</li><li>Most cameras support YUYV and MJPG, and some cameras also support H264 format (c920 supports H264)</li><li>Frame rate drops when capturing YUYV in high resolution<br>(For the c920 camera, only 5fps is supported with YUYV in case of 1920x1080)</li><li>I will proceed with MJPG as an input format that supports 30fps in high resolution in consideration of the above matters.</li></ul><h3>2. Jetson Linux Multimedia API sample Build and Run</h3><ul><li>Move to the 12_camera_v4l2_cuda sample location</li></ul><pre>cd /usr/src/jetson_multimedia_api/samples/12_camera_v4l2_cuda</pre><ul><li>Build</li></ul><pre>sudo make</pre><ul><li>MJPG capture, cuda post process, and display on the screen</li></ul><pre>./camera_v4l2_cuda -d /dev/video0 -s 1920x1080 -f MJPEG -c</pre><ul><li>Explanation of sample (The main logic is done in the while loop(line 606) of camera_v4l2_cuda.cpp)</li></ul><ol><li>Webcam capture with v4l2</li><li>Decoding of capture video with MJPEG format <br>(ctx-&gt;jpegdec-&gt;decodeToFd)</li><li>Convert the decoded video to a render buffer (render_dmabuf_fd) for display<br>(NvBufferTransform(fd, ctx-&gt;render_dmabuf_fd, &amp;transParams))</li><li>Render buffer with cuda Interop (cuda_postprocess) <br>(If -c option is given, a black rectangle appears in the upper left corner of the screen. This is where cuda interop with render buffer happens.)</li><li>Display the render buffer on the screen with EGL Renderer <br>(ctx-&gt;renderer-&gt;render(ctx-&gt;render_dmabuf_fd))</li></ol><h3>3. Convert the sample with AlphaBlending</h3><p>Previously, we said that cuda interop is performed in the cuda_postprocess function of camera_v4l2_cuda.cpp.<br>This process is all within the GPU, not the CPU, so I think this is the best way to optimize Inference performance.<br>Now, let&#39;s proceed to alphablending the video by interoping the captured video with cuda.<br>Sources that need to be modified are:</p><p>camera_v4l2_cuda.cpp (/usr/src/jetson_multimedia_api/samples/12_camera_v4l2_cuda)</p><p>NvCudaProc.h, NvCudaProc.cpp, NvAnalysis.h, NvAnalysis.cu (/usr/src/jetson_multimedia_api/samples/common/algorithm/cuda)</p><p>For the changed part, please refer to the attached source code. (If you search for “//changed by DL Builder”, changes will be searched.)</p><p>In the original source, the Render Buffer was set to YUV420, but in the changed source, it is set to RGBA32.<br>Rect, Text must be overlaid on the image. RGBA32 is the format that supports this.<br>Overlay methods such as Rect and Text overlay will be explained later blog.</p><pre>input_params.payloadType = NvBufferPayload_SurfArray;<br>input_params.width = ctx-&gt;cam_w;<br>input_params.height = ctx-&gt;cam_h;<br>input_params.layout = NvBufferLayout_Pitch;<br><strong><em>input_params.colorFormat = get_nvbuff_color_fmt(V4L2_PIX_FMT_RGB32); //changed by DL Builder</em></strong><br>input_params.nvbuf_tag = NvBufferTag_NONE;<br><br>/* Create Render buffer */<br>if (-1 == NvBufferCreateEx(&amp;ctx-&gt;render_dmabuf_fd, &amp;input_params))<br>    ERROR_RETURN(&quot;Failed to create NvBuffer&quot;);</pre><p>The part that I want to emphasize here is that the Render Buffer of MultiMedia API is interoped with cuda in the next function of NvCudaProc.cpp.</p><pre>static void Handle_AlhapBlending(EGLImageKHR image, int width, int height) //changed by DL Builder<br>{<br>    CUresult status;<br>    CUeglFrame eglFrame;<br>    CUgraphicsResource pResource = NULL;<br><br>    cudaFree(0);<br>    status = cuGraphicsEGLRegisterImage(&amp;pResource, image,<br>                CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE);<br>    if (status != CUDA_SUCCESS)<br>    {<br>        printf(&quot;cuGraphicsEGLRegisterImage failed: %d, cuda process stop\n&quot;,<br>                        status);<br>        return;<br>    }<br><br>    status = cuGraphicsResourceGetMappedEglFrame(&amp;eglFrame, pResource, 0, 0);<br>    if (status != CUDA_SUCCESS)<br>    {<br>        printf(&quot;cuGraphicsSubResourceGetMappedArray failed\n&quot;);<br>    }<br><br>    status = cuCtxSynchronize();<br>    if (status != CUDA_SUCCESS)<br>    {<br>        printf(&quot;cuCtxSynchronize failed\n&quot;);<br>    }<br><br>    if (eglFrame.frameType == CU_EGL_FRAME_TYPE_PITCH)<br>    {<br>        AlphaBlending(<strong><em>(CUdeviceptr) eglFrame.frame.pPitch[0]</em></strong>, width, height);<br>    }<br><br>    status = cuCtxSynchronize();<br>    if (status != CUDA_SUCCESS)<br>    {<br>        printf(&quot;cuCtxSynchronize failed after memcpy\n&quot;);<br>    }<br><br>    status = cuGraphicsUnregisterResource(pResource);<br>    if (status != CUDA_SUCCESS)<br>    {<br>        printf(&quot;cuGraphicsEGLUnRegisterResource failed: %d\n&quot;, status);<br>    }<br>}</pre><p>When the cuda kernel function is executed in NvAnalysis.cu, AlphaBlending is recorded in the Render Buffer.</p><pre>__global__ void AlphaBlending_Kernel(uint8_t *pDevPtr, int width, int height) //changed by DL Builder<br>{<br>    int x = threadIdx.x + blockIdx.x * blockDim.x;<br>    int y = threadIdx.y + blockIdx.y * blockDim.y;<br><br>    if (x &gt;= width || y &gt;= height)<br>        return;<br><br>    float srcAlpha = 0.6;<br><br>    //Blended Color R: 255, G: 160, B: 122<br>    pDevPtr[4 * x + y * width * 4] = srcAlpha * 255 + (1 - srcAlpha) * pDevPtr[4 * x + y * width * 4];<br>    pDevPtr[4 * x + 1 + y * width * 4] = srcAlpha * 160 + (1 - srcAlpha) * pDevPtr[4 * x + 1 + y * width * 4];<br>    pDevPtr[4 * x + 2 + y * width * 4] = srcAlpha * 122 + (1 - srcAlpha) * pDevPtr[4 * x + 2 + y * width * 4];<br>}</pre><p>After replacing the original sampe files with the attached source files,<br>Move to the path</p><pre>cd /usr/src/jetson_multimedia_api/samples/12_camera_v4l2_cuda</pre><p>Build with</p><pre>sudo make</pre><p>If you run the following command, you can see that the video is AlphaBlended on the entire screen.</p><pre>./camera_v4l2_cuda -d /dev/video0 -s 1920x1080 -f MJPEG -c</pre><h4>Attach : Link to changed source file</h4><p><a href="https://drive.google.com/file/d/18p8zn7x9cNZ1YuydaKC4Vff1AmKegE7q/view?usp=sharing">drive.google.com/file/d/18p8zn7x9cNZ1YuydaKC4Vff1AmKegE7q/view?usp=sharing</a></p><p><a href="https://drive.google.com/file/d/1Rha3hol53i90WdgkpuTsabFApffIVlPz/view?usp=sharing">drive.google.com/file/d/1Rha3hol53i90WdgkpuTsabFApffIVlPz/view?usp=sharing</a></p><p><a href="https://drive.google.com/file/d/1OZ2MMgHB0ddxo0iG5duzU5BYtM4M-XcQ/view?usp=sharing">drive.google.com/file/d/1OZ2MMgHB0ddxo0iG5duzU5BYtM4M-XcQ/view?usp=sharing</a></p><p><a href="https://drive.google.com/file/d/1EUULGZ6Va-7uCFM94QPi7LkLFx1k7Nz6/view?usp=sharing">drive.google.com/file/d/1EUULGZ6Va-7uCFM94QPi7LkLFx1k7Nz6/view?usp=sharing</a></p><p><a href="https://drive.google.com/file/d/1AXuuwqXO5QYeRJJiWIJ9VxhUNpI3W1br/view?usp=sharing">drive.google.com/file/d/1AXuuwqXO5QYeRJJiWIJ9VxhUNpI3W1br/view?usp=sharing</a></p><p><strong><em>If you are interested in deep learning inference in c++, feel free to visit </em></strong><a href="https://dlbuilder.ai/"><strong><em>https://dlbuilder.ai</em></strong></a><strong><em> (Train once, Inference anywhere)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e0236c97249" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tensorflow 2.3.1 C++ Build and Inference on Jetson Nano (1)]]></title>
            <link>https://dlbuilder.medium.com/tensorflow-2-3-1-c-build-and-inference-on-jetson-nano-1-b04fdb442cc9?source=rss-1b7589c60566------2</link>
            <guid isPermaLink="false">https://medium.com/p/b04fdb442cc9</guid>
            <category><![CDATA[tensorflow-inference]]></category>
            <category><![CDATA[tensorflow-jetson]]></category>
            <category><![CDATA[tensorflow-cpp-build]]></category>
            <category><![CDATA[tensorflow-build]]></category>
            <category><![CDATA[tensorflow-2-build]]></category>
            <dc:creator><![CDATA[DL Builder]]></dc:creator>
            <pubDate>Thu, 15 Oct 2020 09:48:14 GMT</pubDate>
            <atom:updated>2020-11-08T06:59:40.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deep Learnig C++ Inference on Jetson Nano (1)</h3><h4>Tensorflow 2.3.1 C++ Build on Jetson Nano</h4><p>In this blog, I would like to build Tensorflow in the Nvidia jetson environment so that it can be used in a c++ environment instead of python, and use it to inference a model trained with Tensorflow.</p><p>In this first article, I will introduce how to build Tensorflow’s c++ library and header in Nvidia Jetson environment.</p><h3>Prerequisite</h3><ul><li>Jetson Nano with Jetpack 4.4</li><li>SD card : 64GB (If you proceed with 32GB, you may run out of capacity.)</li><li>Power : Barrel Jack (Jetson power off during build process when powered by Micro USB)</li><li>Long Long Time : It took about 35 hours to complete the build<br>(At the bottom of the article, I have linked the results of my build for you.)</li><li>Power -&gt; Blank Screen -&gt; Never in Setting</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*AvbntKEm6wFvp-Sus6ow6Q.png" /></figure><ul><li><strong>Please do not run other applications while build is in progress. Jetson may crash.</strong></li></ul><h3>Environment Setup</h3><ul><li>Create Folder for Build</li></ul><pre>cd ~<br>mkdir tfbuild</pre><ul><li>Set Jetson to Performance Mode</li></ul><pre>sudo nvpmodel -m 0<br>sudo jetson_clocks</pre><ul><li>Add 8GB Swap</li></ul><pre>cd ~/tfbuild<br>sudo dd if=/dev/zero of=swapfile bs=1024 count=8388608<br>sudo mkswap swapfile<br>sudo swapon swapfile</pre><p><strong>If you reboot, run the following command again</strong></p><pre>cd ~/tfbuild<br>sudo swapon swapfile</pre><ul><li>Bazel Install</li></ul><p>After downloading the sh file from the following link, run it in the terminal to install bazel.</p><p>The bazel version is different for each tensorflow version. We use bazel 3.1 for tensorflow 2.3.1 build.</p><p><a href="https://drive.google.com/file/d/1xFKA264QRNn0zEbd23X9A_eoDwQueh9J/view?usp=sharing">install_bazel-3.1.0.sh</a></p><pre>sudo apt-get update<br>./install_bazel-3.1.0.sh</pre><p>It will take some time to complete the above command. (If I remember correctly, it would have taken about 15 minutes)</p><p>When bazel installation is complete, set the bazel path in the .bashrc.</p><pre>gedit ~/.bashrc</pre><p>Add the following to the last line.</p><blockquote><em>export PATH=${PATH}:~/bin</em></blockquote><p>To reflect the above path changes in the currently opened terminal</p><pre>source ~/.bashrc</pre><ul><li>pip installation and symbolic link change</li></ul><pre>sudo apt-get install python3-pip<br>sudo ln -sf /usr/bin/python3 /usr/bin/python<br>sudo ln -sf /usr/bin/pip3 /usr/bin/pip</pre><ul><li>Cuda Path Setting</li></ul><p>Jetson comes with Cuda installed by default. For build, you only need to set Cuda Path as follows.</p><pre>gedit ~/.bashrc</pre><p>Add the following to the last line.</p><blockquote><em>export PATH=${PATH}:/usr/local/cuda/bin<br>export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64</em></blockquote><p>To reflect the above path changes in the currently opened terminal</p><pre>source ~/.bashrc</pre><ul><li>Protobuf Install</li></ul><p>The protobuf version is different for each tensorflow version. We install protobuf cpp 3.9.2 for tensorflow 2.3.1 build.</p><pre>cd ~/tfbuild<br>wget <a href="https://github.com/protocolbuffers/protobuf/releases/download/v3.9.2/protobuf-cpp-3.9.2.zip">https://github.com/protocolbuffers/protobuf/releases/download/v3.9.2/protobuf-cpp-3.9.2.zip</a><br>unzip protobuf-cpp-3.9.2.zip<br>cd protobuf-3.9.2/cmake<br>mkdir build &amp;&amp; cd build<br>cmake ..<br>make -j8<br>sudo make install</pre><h3>Tensorflow Download and Build</h3><ul><li>Tensorflow Download and Configure</li></ul><pre>cd ~/tfbuild<br>wget <a href="https://github.com/tensorflow/tensorflow/archive/v2.3.1.tar.gz">https://github.com/tensorflow/tensorflow/archive/v2.3.1.tar.gz</a> -O tensorflow-2.3.1.tar.gz<br>tar xzvf tensorflow-2.3.1.tar.gz<br>cd tensorflow-2.3.1<br>./configure</pre><p>during configure</p><blockquote>cuda : y</blockquote><blockquote>tensorrt : y</blockquote><blockquote>cuda capabilities : 5.3,6.2,7.2</blockquote><p>enter for all the reset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMaeyLoy9OVKbzl1a8uw-g.png" /></figure><p>The cuda capabilities are set for all the equipment of the Jetson series.<br><strong>If the device capabilities value and the build value do not match, the tensorflow initialization process takes a very long time.</strong></p><p>For cuda capabilities by graphic card, refer to the following link.</p><p><a href="https://developer.nvidia.com/cuda-gpus">developer.nvidia.com/cuda-gpus</a></p><ul><li>command for libraray build</li></ul><pre>cd ~/tfbuild/tensorflow-2.3.1<br>bazel build — config=opt — config=cuda — config=noaws \<br> — jobs 4 — local_ram_resources=HOST_RAM*0.5 — verbose_failures //tensorflow:libtensorflow_cc.so</pre><p><strong>※ </strong>This process takes about 35 hours. ~~</p><ul><li>command for header build</li></ul><pre>cd ~/tfbuild/tensorflow-2.3.1<br>bazel build — config=opt — config=cuda — config=noaws //tensorflow:install_headers</pre><ul><li>Build Result</li></ul><pre>cd ~/tfbuild/tensorflow-2.3.1/bazel-bin/tensorflow</pre><p>In the foloder,</p><p>we need the next 5 files</p><p>libtensorflow_cc.so</p><p>libtensorflow_cc.so.2</p><p>libtensorflow_cc.so.2.3.1</p><p>libtensorflow_framework.so.2</p><p>libtensorflow_framework.so.2.3.1</p><p>and 1 folder</p><p>include</p><p>for development.</p><p><strong>Please refer to the link below as I uploaded the result of my build to save time for you.</strong></p><p><a href="http://drive.google.com/file/d/1b9dmKy_Pd7VANunURkWTN8eHS2ClnEyK/view?usp=sharing">drive.google.com/file/d/1b9dmKy_Pd7VANunURkWTN8eHS2ClnEyK/view?usp=sharing</a></p><p><strong><em>If you are interested in deep learning inference in c++, feel free to visit </em></strong><a href="https://dlbuilder.ai/"><strong><em>https://dlbuilder.ai</em></strong></a><strong><em> (Train once, Inference anywhere)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b04fdb442cc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>