Control Caffe console output in python

If you are using Caffe framework in Python, you will find that its prints a lot of information on console. You can control this output by setting up an environment variable in python application:

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

Following levels are available:

- Debug => 0
- Info => 1
- Warnings => 2
- Errors => 3

NOTE: ‘GLOG_minloglevel‘ must be set before `import caffe` statement otherwise it will not work.

FYI: Caffe uses Google logging module (https://github.com/google/glog) for logging output.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s