CPU instructions not compiled with TensorFlow

左心房为你撑大大i 提交于 2019-11-30 05:25:52

NOTE : These are not error messages but mere warning messages.

The best way to maximise TF performance (apart from writing good code !!), is to compile it from the sources

When you do that, TF would ask you for a variety of options which will also involve options for these instructions.

In my own experience, compilation from the source is better in performance on an average.

If you are doing some intensive processing that could be done on a GPU then that might also explain your waiting time. For GPU support you would need to do pip3 install tensorflow-gpu

These are warning which mean it may be faster to build tensorflow on your pc from source.

However if you want to disable them, you may use the code below

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

this should silence the warnings. 'TF_CPP_MIN_LOG_LEVEL' represents the Tensorflow environment variable responsible for logging. Also if you are on Ubuntu you may use this code below

export TF_CPP_MIN_LOG_LEVEL=2 

I hope this helps.

Tai Christian

You can also compile using bazel with opt arguments:

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

I think you can find something in this discussion: How to compile Tensorflow with SSE4.2 and AVX instructions?

Good luck!

Those are simply warnings. They are just informing you if you build TensorFlow from source it can be faster on your machine. Those instructions are not enabled by default on the builds available I think to be compatible with more CPUs as possible. If you have any other doubts regarding this please feel free to ask, otherwise this can be closed.

Try export TF_CPP_MIN_LOG_LEVEL=2

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!