Tensorflow抑制警告消息

时间:2020-01-31 04:31:50

标签: tensorflow

运行程序时,我始终始终收到以下消息。

2020-01-30 22:30:20.071341: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-01-30 22:30:20.211074: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fd9662a5830 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-01-30 22:30:20.211123: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version

是否有必要?我该如何抑制?

1 个答案:

答案 0 :(得分:0)

在文件顶部定义

import logging
logging.getLogger('tensorflow').disabled = True