Search code examples
caffepycaffematcaffe

Reading dangerously large protocol message Caffe warning


I am trying to fine tune the fully convolutional nets for my problem. I am getting the following warning. Why I am getting this warning?

     [libprotobuf WARNING google/protobuf/io/coded_stream.cc:505] Reading dangerously 
     large protocol message.  If the message turns out to be larger than 2147483647 bytes, 
     parsing will be halted for security reasons.  To increase the limit (or to disable 
     these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.

Solution

  • 2147483647 is the max value that you can store in an integer data type in C++.

    Caffe reads the .prototxt file into a buffer and then reads the parameters from the buffer. This buffer is defined internally to be of a maximum size of 2147483647 bytes. So if the .prototxt file is too large, it may not fit into this buffer. So Caffe gives this warning to increase the limit.