I've been modifying an example C++ program from the Caffe deep learning library and I noticed this code on line 234 that doesn't appear to be referenced again.
::google::InitGoogleLogging(argv[0]);
The argument provided is a prototxt file which defines the parameters of the deep learning model I'm calling. The thing that is confusing me is where the results from this line go? I know they end up being used in the program because if I make a mistake in the prototxt file then the program will crash. However I'm struggling to see how the data is passed to the class performing the classification tasks.
Unless otherwise specified, glog writes to the filename "/tmp/<program name>. <hostname>. <user name>. log.
Thread safe useThe default use of goby::glog is not thread safe. To enable thread-safe access (uses a mutex lock/unlock for each call from goby::util::FlexOstream::is to std::endl or std::flush), set (before any concurrent access): goby::glog.
First of all, argv[0]
is not the first argument you pass to your executable, but rather the executable name. So you are passing to ::google::InitGoogleLogging
the executable name and not the prototxt file.'glog'
module (google logging) is using this name to decorate the log entries it outputs.
Second, caffe is using google logging (aka 'glog'
) as its logging module, and hence this module must be initialized once when running caffe. This is why you have this
::google::InitGoogleLogging(argv[0]);
in your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With