简言之2条命令即可:
1 2 3 4 5
|
$ GLOG_minloglevel=2 caffe-command
$ TF_CPP_MIN_LOG_LEVEL=3 tensorflow-command
|
或者在python文件中,import caffe或tensorflow之前,执行如下的语句:
1 2 3 4 5 6 7 8
|
import os os.envrion['GLOG_minloglevel'] = '2'
import os os.envrion['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
参考:
- https://stackoverflow.com/questions/29788075/setting-glog-minloglevel-1-to-prevent-output-in-shell-from-caffe
- http://littlewhite.us/archives/157
- https://stackoverflow.com/questions/38073432/how-to-suppress-verbose-tensorflow-logging