<?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 Jamie Arjona on Medium]]></title>
        <description><![CDATA[Stories by Jamie Arjona on Medium]]></description>
        <link>https://medium.com/@jarjona_71253?source=rss-443122ee8347------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pNVY4KCs1cJ_bUwm.</url>
            <title>Stories by Jamie Arjona on Medium</title>
            <link>https://medium.com/@jarjona_71253?source=rss-443122ee8347------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:25:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jarjona_71253/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[Tensorflow from sources (Windows 10 version)]]></title>
            <link>https://medium.com/worldsensing-techblog/tensorflow-from-sources-windows-10-version-ea9c6a4ea657?source=rss-443122ee8347------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea9c6a4ea657</guid>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[windows-10]]></category>
            <dc:creator><![CDATA[Jamie Arjona]]></dc:creator>
            <pubDate>Fri, 17 May 2019 09:03:47 GMT</pubDate>
            <atom:updated>2019-05-17T09:03:47.724Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SSkEMlW6bCtJjDyrN8RHg.png" /></figure><p>Have you ever wanted to build tensorflow from source files in order to take better profit of your hardware? Then, this is your guide.</p><h3>What it is needed</h3><p>First, it is necessary to download the following programs:</p><ol><li><strong>Python</strong> with <strong>pip </strong>(<a href="https://www.python.org/downloads/"><em>https://www.python.org/downloads/</em></a><em>)</em>.</li><li><strong>MSYS2 </strong>(<a href="https://www.msys2.org/"><em>https://www.msys2.org/</em></a>).</li><li><strong>Visual C++ Build Tools 2015 </strong>(<a href="https://visualstudio.microsoft.com/es/downloads/"><em>https://visualstudio.microsoft.com/es/downloads</em></a><em> </em>we will download Visual Studio community edition where we can find the C++ build tools<em>).</em></li><li><strong>Bazel </strong>(<a href="https://www.bazel.build/"><em>https://www.bazel.build/</em></a>).</li><li><strong>CUDA Toolkit and cuDNN libraries in case of using a CUDA compatible GPU</strong> (<a href="https://developer.nvidia.com/cuda-gpus"><em>https://developer.nvidia.com/cuda-gpus</em></a>).</li></ol><p>After the download of the required programs, the instructions below must to be followed.</p><h3>Previous configurations</h3><p>First, we will add the <strong>Python</strong> and <strong>pip</strong> directories into the environment system variable Path once they are installed. The default Python directory is <em>C:\Program Files\Python </em>and for pip is <em>C:\Program Files\Python\Scripts.</em></p><p>After the installation of <strong>MSYS2</strong>, it is needed to add into the variable Path its root path (<em> C:\msys64</em> by default) and its bin folder ( <em>C:\msys64\usr\bin</em>). Then, execute <em>pacman -S git patch unzip </em>on a console (cmd, powershell, bash, etc.) in order to install the necessary dependencies.</p><p>For the <strong>Visual C++ build tools</strong>, on the installation menu of the Visual Studio, check the option to install the Visual C++ build tools and then, check the Windows 10 SDK and the VC++ 2015 toolset for desktop (only those are needed) in the right part of the menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cZSGr6mDCOfnqWNRRZRPqA.png" /><figcaption>Visual Studio installation menu.</figcaption></figure><p>In the case of <strong>Bazel</strong>, it is needed to rename the downloaded file from the git repository (<a href="https://github.com/bazelbuild/bazel/releases"><em>https://github.com/bazelbuild/bazel/releases</em></a><em> where we download bazel-&lt;version&gt;-windows-x86_64.exe</em>) to <em>bazel.exe</em>. After that, also it is needed to add the variable <em>BAZEL_SH</em> in our environment system variables with value <em>c:\msys64\usr\bin\bash.exe. </em>Also, it is needed the variable <em>BAZEL_VS</em> with value Microsoft Visual Studio home<em> (C:\Program Files (x86)\Microsoft Visual Studio 14.0</em> by default).</p><p>While the installation of <strong>CUDA</strong> is easy, the <strong>cuDNN</strong> installation could be a little tricky. First install CUDA, then, download cuDNN from <a href="https://developer.nvidia.com/cudnn"><em>https://developer.nvidia.com/cudnn</em></a><em> </em>and unzip it. Then, copy the following files:</p><ol><li><em>\cuda\bin\cudnn64_7.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin</em></li><li><em>\cuda\ include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include</em></li><li><em>\cuda\lib\x64\cudnn.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64</em></li></ol><p>Next, it is needed to create a <em>CUDA_PATH</em> environment variable with value the directory where the CUDA is installed (usually <em>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0).</em></p><p>Lastly, it is needed to add a variable called <em>JAVA_HOME</em> with value the java folder (usually <em>C:\Program Files\Java\jre1.8.0_13).</em></p><h4>Python packages needed</h4><p>In addition, the following python packages are needed to be installed before the installation of tensorflow:</p><ol><li>The python libraries six, numpy and wheel. (<em>pip3 install six numpy wheel</em>)</li><li>The following parts of the keras library: keras_applications and keras_preprocessing.<br>(<em>pip3 install keras_applications==1.0.5 — no-deps</em><br><em>pip3 install keras_preprocessing==1.0.3 — no-deps</em>)</li></ol><h3>Tensorflow building</h3><p>The next step is to download tensorflow from git (<em>git clone </em><a href="https://github.com/tensorflow/tensorflow.git"><em>https://github.com/tensorflow/tensorflow.gi</em>t</a>), enter into the cloned folder and execute <em>python ./configure.py </em>in a command console (again any of the following: bash, cmd, powershell, MSYS2, etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*8rvmoh656YnX5BAYgrD85A.png" /><figcaption>Let’s go with Bazel and tensorflow source files (and its warnings).</figcaption></figure><h4>Bazel orders step by step</h4><ol><li>Enter Python location. If it is in the system environment variables then, it will detect the one by default.</li><li>Next, the configurator will ask for the Python library path. If the Python location is configured in the system environment variables, it will be detected by default.</li><li>ROCm support. These instructions are used by AMD GPUs. If you have one, active it. If not, skip it.</li><li>CUDA support. This one is for Nvidia GPUs. Skip it if not owning an Nvidia GPU with CUDA.</li><li>If we have chosen to install the CUDA support, then, the prompt will ask for the folder where the cuDNN libraries are installed.</li><li>When asked by the prompt about the AVX support (AVX and AVX2 are a set of instructions used by modern CPUs since Haswell microarchitecture), use the instruction <em>/arch:AVX</em> or <em>/arch:AVX2</em> or n (depending on your CPU microarchitecture).</li><li>The last question is about override eigen strong inline for some C++ compilation in order to reduce the compilation time. I asked yes. (Information about Eigen C++ library: <a href="https://bitbucket.org/eigen/eigen/src/677c9f1577810e869f4f09881cabc3e503a810c1/unsupported/Eigen/CXX11/src/Tensor/README.md?at=default&amp;fileviewer=file-view-default#markdown-header-class-tensorref"><em>https://bitbucket.org/eigen/eigen/src</em></a><em>).</em></li></ol><p>With this, the Blaze part is over. Now, it is the time to compile the tensorflow libraries.</p><h4>Compiling the package</h4><p>This is the command to build CPU tensorflow:</p><p><em>bazel build — config=opt //tensorflow/tools/pip_package:build_pip_package</em></p><p>For GPU version:</p><p><em>bazel build — config=opt — config=cuda //tensorflow/tools/pip_package:build_pip_package</em></p><p>Take into account that the process takes several hours.</p><p>Once finished, we can proceed to install the package in our Python environment.</p><h4>Finally, installing tensorflow</h4><p>First, it is needed to generate the .whl file and then, use it via pip:</p><ol><li><em>bazel-bin/tensorflow/tools/pip_package/build_pip_package C:/tmp/tensorflow_pkg</em></li><li><em>pip3 install C:/tmp/tensorflow_pkg/tensorflow-version-cp36-cp36m-win_amd64.whl</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*5apfNlEKhyYJms9-rGGhtA.png" /><figcaption>Finishing to install tensorflow.</figcaption></figure><p>And that’s all, for sure we will notice an speed up in the creation of our models.</p><p>If you found this post interesting, we are always hiring and interested in meeting all types of engineers, regardless of your skills or what tools you use day-to-day. Your intelligence, creativity, energy and enthusiasm are much more important to us than your experience with our stack.</p><p>Check out our careers page in here — <a href="https://worldsensing.wpengine.com/engineering/">https://worldsensing.wpengine.com/engineering/</a></p><h3>Sources</h3><ul><li><a href="https://www.tensorflow.org/install/source_windows">Build from source on Windows | TensorFlow</a></li><li><a href="https://docs.bazel.build/versions/master/install-windows.html">Installing Bazel on Windows</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea9c6a4ea657" width="1" height="1" alt=""><hr><p><a href="https://medium.com/worldsensing-techblog/tensorflow-from-sources-windows-10-version-ea9c6a4ea657">Tensorflow from sources (Windows 10 version)</a> was originally published in <a href="https://medium.com/worldsensing-techblog">Worldsensing TechBlog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>