caffe glog作用_设置GLOG_minloglevel = 1以防止Caffe在Shell中输出

I'm using Caffe, which is printing a lot of output to the shell when loading the neural net.

I'd like to suppress that output, which supposedly can be done by setting GLOG_minloglevel=1 when running the Python script. I've tried doing that using the following code, but I still get all the output from loading the net. How do I suppress the output correctly?

os.environ["GLOG_minloglevel"] = "1"

net = caffe.Net(model_file, pretrained, caffe.TEST)

os.environ["GLOG_minloglevel"] = "0"

解决方案

To supress the output level you need to increase the loglevel to at least 2

os.environ['GLOG_minloglevel'] = '2'

The levels are

0 - debug

1 - info (still a LOT of outputs)

2 - warnings

3 - errors

Update:

Since this flag is global to caffe, it must be set prior to importing of caffe package (as pointed out by jbum). Once the flag is set and caffe is imported the behavior of the GLOG tool cannot be changed.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值