11

I successfully installed cpu only tensorflow on ubuntu 16.04 using the default instructions provided here. The instructions recommended using virtualenv and pip so I did not build from source. I had no problems installing with these instructions.

I validated my installation using the instructions provided further down on the same page, and while the program ran successfully, it output the following warnings.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
Hello, TensorFlow!

all the stackoverflow pages i've looked at only address people who have built from source using bazel, but don't seem to apply to people who used pip.

How do I recompile or update my installation so as to the SSE instructions?

Community
  • 1
  • 1
CuriousDan
  • 173
  • 1
  • 1
  • 8
  • it could be that you have some mixed environments issue, in the past i did use source code to install tensorflow on ubuntu 16.04, but since v.0.11 simple pip install works ok – volody Feb 20 '17 at 01:26
  • I have compiled tensorflow to use SSE instructions. You can download the precompiled binaries from https://github.com/lakshayg/tensorflow-build. – lakshayg Jul 10 '17 at 03:23

3 Answers3

3

You must use bazel with --config=opt option to build a wheel customized for your architecture, and then use pip to install the resulting wheel.

I plan to occasionally upload 2014 MacBook + Xeon V3 optimized builds to https://github.com/yaroslavvb/tensorflow-community-wheels

Once you install Bazel, making a wheel for your pip command is roughly as follows

./configure

export LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH"
export flags="--config=opt --config=cuda -k"

bazel build $flags -k //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

Then wheel is dropped into /tmp/tensorflow_pkg

Yaroslav Bulatov
  • 57,332
  • 22
  • 139
  • 197
  • Hm, would you mind telling me at which step in the installation I should do this? I've literally just followed the instructions for virtualenv on the tensorflow tutorial, and don't know where I should do this configuration step – CuriousDan Feb 21 '17 at 06:28
  • 1
    You need to follow instructions for building from source – Yaroslav Bulatov Feb 21 '17 at 17:07
  • I'm not really willing to deal with any problems that might come by building from source.. I'll just put it in as an issue on the tensorflow github for now and deal with warnings edit: Pressed enter expecting new paragraph – CuriousDan Feb 24 '17 at 16:55
1
bazel build --linkopt='-lrt' -c opt --copt=-mavx --copt=-msse4.2 --copt=-msse4.1 --copt=-msse3-k //tensorflow/tools/pip_package:build_pip_package

If above solved your problem ,vote up Christian Frei's answer on How do I resolve these tensorflow warnings?

Community
  • 1
  • 1
Ajay Singh
  • 1,251
  • 14
  • 17
0

Those are just warnings. As per this link, add this lines before importing TensorFlow,

import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf

I also have the same problem, but the suggested link solved my problem.

Also look at this answer, it will help to know more about SSE information and also the different types of log indicators.

Krunal Kapadiya
  • 2,853
  • 3
  • 16
  • 37