如何在输出窗口中隐藏Tensorflow日志记录信息

时间:2018-04-26 22:28:46

标签: python tensorflow pycharm

我是Python的新手。使用Pycharm IDE我遵循this教程。完整的代码是here

这段代码是迭代的,运行代码,对于我得到的每次迭代:

INFO:tensorflow:probabilities = [[0.00901909 0.20229901 0.04168228 0.03380775 0.04164521 0.07095326
  0.30759975 0.00563797 0.21675842 0.07059734]
 [0.00563906 0.03731773 0.0232646  0.09292353 0.01161542 0.06653289
  0.00265419 0.6255797  0.1038143  0.03065847]
 [0.00655828 0.00330277 0.00782441 0.00087765 0.4640763  0.02524412
  0.03457317 0.00737278 0.0192651  0.43090546]
                    .
                    .(a lot of this lines)
                    .
                    .
 [0.16861711 0.0002838  0.07394045 0.08323438 0.01832635 0.39693028
  0.1004111  0.01663646 0.07882028 0.06279974]
 [0.01767829 0.25284573 0.06204544 0.13148794 0.005388   0.03389382
  0.04371805 0.00890654 0.4342947  0.00974149]]
INFO:tensorflow:loss = 0.802033, step = 2273

我不希望每次迭代都在“运行”窗口中显示INFO:tensorflow:probabilities

隐藏计算\命令输出显示在MATLAB中,我到目前为止使用,放置一个“;”在一行的末尾隐藏其结果。我不知道怎么在Pycharm中得到它。已在线搜索。

感谢。

1 个答案:

答案 0 :(得分:3)

更改第#132

的值

tensors_to_log = {"probabilities": "softmax_tensor"}或将其设为空字典{}

或者不在第#146

传递logging_hook参数

或将tf.logging.level设置为仅限#23

行的警告
tf.logging.set_verbosity(tf.logging.WARN)

致谢:@bitsplit

有关记录的更多详细信息:Tensorflow API documentation