Setting GLOG_minloglevel=1 to prevent output in shell from Caffe

前端 未结 2 1582
北荒
北荒 2020-12-15 04:22

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

相关标签:
2条回答
  • 2020-12-15 05:00

    I was able to get Shai's solution to work, but only by executing that line in Python before calling

    import caffe
    
    0 讨论(0)
  • 2020-12-15 05:22

    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.

    0 讨论(0)
提交回复
热议问题