3

I'm new to Tensorflow. I am using a 64 bit version of Windows 10 and I would like to install Tensorflow for the CPU. I don't remember the exact steps that I followed to install it, however when I checked for the installation using:

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

I have the following output:

2017-10-18 09:56:21.656601: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-10-18 09:56:21.656984: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
b'Hello, TensorFlow!'

I am running python in Sublime Text 3 using the package SublimeREPL. I tried to search these errors and found out that it means that the tensorflow is built without these instructions which could improve performances for the CPU. I also found the code to hide these warnings, but I actually I want to use these instructions.

The code that I found that enables this is:

bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-msse4.2 --copt=-msse4.1 --copt=-msse3 --copt=-mfma -k //tensorflow/tools/pip_package:build_pip_package

but I got this output:

ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': no such package 'tensorflow/tools/pip_package': BUILD file not found on package path.
WARNING: Target pattern parsing failed. Continuing anyway.
INFO: Found 0 targets...
ERROR: command succeeded, but there were errors parsing the target pattern.
INFO: Elapsed time: 8,147s, Critical Path: 0,02s

How can I solve this problem? Lastly, I don't understand what pip, wheel and bazel are so I need a step by step instructions.

Thank you a lot!

Sorin Moruz
  • 31
  • 1
  • 2
  • 1
    Possible duplicate of [TensorFlow wasn't compiled to use SSE (etc.) instructions, but these are available](https://stackoverflow.com/questions/43134753/tensorflow-wasnt-compiled-to-use-sse-etc-instructions-but-these-are-availab) – GPhilo Oct 18 '17 at 08:15
  • I don't want to hide the warnings, I want to use the AVX - AVX2 instructions, but don't know how – Sorin Moruz Oct 18 '17 at 08:23
  • From the answer to the linked question: "Enabling these operations is a compile-time operation (i.e. to use SSE you need to build the library from the source enabling the specific SSE version you're targeting), in which case you might [take a look at this question](https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions)." – GPhilo Oct 18 '17 at 08:24
  • I tried the code in that post but I got these errors: `WARNING: Config values are not defined in any .rc file: cuda. ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': no such package 'tensorflow/tools/pip_package': BUILD file not found on package path. WARNING: Target pattern parsing failed. Continuing anyway. INFO: Found 0 targets... ERROR: command succeeded, but there were errors parsing the target pattern. INFO: Elapsed time: 7,622s, Critical Path: 0,01` – Sorin Moruz Oct 18 '17 at 08:30
  • Did you run `configure` before actually trying to build it? (as per [Tensorflow instructions on how to build the library](https://www.tensorflow.org/install/install_sources))? – GPhilo Oct 18 '17 at 08:33
  • I've found this comand but actually I don't know where to run it since I am using Windows. If I just run `bazel ./configure` I got: `Command './configure' not found. Try 'bazel help'.` Thank you so much for you effort in helping me, as you already understood I don't really know what I am doing. – Sorin Moruz Oct 18 '17 at 08:35
  • configure is a shell script thought for linux. Building under Windows is much more painful (and not officially supported), I'm afraid. You may give a try to the Tensorflow cmake build and see if that helps, but otherwise I'd suggest you to stick to the prebuilt binaries (AVX and AVX2 instructions did not introduce a major speedup in the build tests I tried, at least) – GPhilo Oct 18 '17 at 08:47
  • I just found where to run it: I have to install MinGW (MSYS 2) and in there I can run the git clone comand. We are making progress!!! :D now what should I do? – Sorin Moruz Oct 18 '17 at 08:53
  • Ehm.. I have no clue, I built only under linux :) You might want to have look at the links in the Tensorflow setup from build from my previous comment and see there if you can get to some guide for Windows (I think the experimental bazel for Windows might be a good start) – GPhilo Oct 18 '17 at 08:58
  • 1
    You were my guide!!! T_T I manage to figure out something. Thank you for your support so far! – Sorin Moruz Oct 18 '17 at 09:05

1 Answers1

0

if you want to download TensorFlow source, compile+install, use this link.
If you want to download binaries, then use this link.