How do I resolve these tensorflow warnings?

后端 未结 7 915
北恋
北恋 2020-12-31 06:36

I just installed Tensorflow 1.0.0 using pip. When running, I get warnings like the one shown below.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The Ten

7条回答
  •  时光取名叫无心
    2020-12-31 07:09

    As the warnings say you should only compile TF with these flags if you need to make TF faster.

    You can use TF environment variable TF_CPP_MIN_LOG_LEVEL and it works as follows:

    • It defaults to 0, displaying all logs
    • To filter out INFO logs set it to 1
    • WARNINGS additionally, 2
    • and to additionally filter out ERROR logs set it to 3

    So you can do the following to silence the warnings:

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

提交回复
热议问题