CPU instructions not compiled with TensorFlow

MacBook Air: OSX El Capitan

When I run the TensorFlow code in terminal ( python 3 tfpractice.py), I get a longer than usual wait time for returning output, followed by these error messages:

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. W 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. W 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. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

I do not know how to fix this. I would like TensorFlow to just work on this pip3 installation. So I went the way:tensorflow/core/platform/cpu_feature_guard

Do I need to edit the code here? Or is there an alternative way to get TensorFlow to compile these instructions?

I installed TensorFlow with sudo pip3 install tensorflow.

+6
source share
4 answers

. , .

TF ( !) ,

, TF , .

, .

, , . GPU pip3 install tensorflow-gpu

+9

, , .

, ,

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

. "TF_CPP_MIN_LOG_LEVEL" Tensorflow, . , Ubuntu,

export TF_CPP_MIN_LOG_LEVEL=2 

, .

+4

bazel opt:

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

, - : Tensorflow SSE4.2 AVX?

!

+2
source

These are just warnings. They just inform you, if you create TensorFlow from a source, it can be faster on your computer. These instructions are not included by default in available assemblies. I think that they are compatible with a large number of processors. If you have any other doubts about this, feel free to ask, otherwise it may be closed.

Try export TF_CPP_MIN_LOG_LEVEL=2

https://github.com/tensorflow/tensorflow/issues/7778

-3
source

Source: https://habr.com/ru/post/1015277/


All Articles