减少控制台冗长 [英] Reduce console verbosity
问题描述
我正在使用Keras/TensorFlow进行一些训练和预测,并且得到了一些我不需要的OMP信息.
I am running some training and prediction with Keras/TensorFlow and I get some OMP information that I do not need.
2019-05-20 12:11:45.625897: I tensorflow/core/common_runtime/process_util.cc:71] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best p
erformance.
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22400 thread 1 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22428 thread 2 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22429 thread 3 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22430 thread 4 bound to OS proc set 4
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22431 thread 5 bound to OS proc set 5
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22432 thread 6 bound to OS proc set 6
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22433 thread 7 bound to OS proc set 7
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22434 thread 8 bound to OS proc set 8
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22435 thread 9 bound to OS proc set 9
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22436 thread 10 bound to OS proc set 10
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22437 thread 11 bound to OS proc set 11
OMP: Info #250: KMP_AFFINITY: pid 22357 tid 22438 thread 12 bound to OS proc set 0
如何消除这种多余的言语?
How can I remove this extra verbosity?
推荐答案
As(比我更有资格谈论这个话题) Jim Cownie 指出,此输出似乎是由于用属性verbose
定义了KMP_AFFINITY
所致.参见
As (the vastly more qualified to talk about this topic than me) Jim Cownie points out, this output appears to be due to having KMP_AFFINITY
defined with the attribute verbose
. See The KMP_AFFINITY
Environment Variable and set the environment variable accordingly (the default value is noverbose,respect,granularity=core,none,0,0
).
(以下可能是错误的信息)
(likely wrong information below)
我认为,如果禁用将环境变量KMP_WARNINGS
设置为off
或0
的OpenMP警告,这些消息应该消失.从外壳:
I think those messages should go away if you disable the OpenMP warnings setting the environment variable KMP_WARNINGS
to off
or 0
. From a shell:
$ KMP_WARNINGS=off python program.py
或者从Python本身开始,在OpenMP初始化之前:
Or from Python itself, before OpenMP is initialized:
import os
os.environ['KMP_WARNINGS'] = 'off'
这篇关于减少控制台冗长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!