Skip to content

Commit

Permalink
Suppress output for python bindings
Browse files Browse the repository at this point in the history
Only allow output for errors
  • Loading branch information
lukeyeager committed Jun 11, 2015
1 parent 2f4a9e4 commit d100766
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/caffe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Suppress GLOG output for python bindings
# unless explicitly requested in environment
import os
if 'GLOG_minloglevel' not in os.environ:
# Hide INFO and WARNING, show ERROR and FATAL
os.environ['GLOG_minloglevel'] = '2'
_unset_glog_level = True
else:
_unset_glog_level = False

from .pycaffe import Net, SGDSolver
from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
from .proto.caffe_pb2 import TRAIN, TEST
from .classifier import Classifier
from .detector import Detector
from . import io

if _unset_glog_level:
del os.environ['GLOG_minloglevel']

0 comments on commit d100766

Please sign in to comment.