屏蔽 tensorflow 警告日志! the TensorFlow library wasn't compiled to use SSE4.2 instructions, but these……

在使用tensor flow时,控制台报错如下:the TensorFlow library wasn't compiled to use SSE4.2 instructions, but these……

 

TensorFlow的日志级别分为以下三种:

TF_CPP_MIN_LOG_LEVEL = 1 //默认设置,为显示所有信息

TF_CPP_MIN_LOG_LEVEL = 2 //只显示error和warining信息

TF_CPP_MIN_LOG_LEVEL = 3 //只显示error信息

所以,当TensorFlow出现警告信息,又不想让警告信息显示时,可进行如下设置:

python环境下

通过在python文件中添加如下两行代码,设置TensorFlow日志输出级别

import os

os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"

 

 

 

你可能感兴趣的:(屏蔽 tensorflow 警告日志! the TensorFlow library wasn't compiled to use SSE4.2 instructions, but these……)