diff options
author | Jeff Donahue <jeff.donahue@gmail.com> | 2014-10-16 13:24:39 -0700 |
---|---|---|
committer | Jeff Donahue <jeff.donahue@gmail.com> | 2015-01-19 16:48:33 -0800 |
commit | 60f26d647ceccea5d0ab0bf85b35b492886bf451 (patch) | |
tree | 98288d3d611e70d22d7e10b35c85848df764e27f /src | |
parent | bf5b77472603ea0d62574661dd61c57f2726a9c9 (diff) | |
download | caffeonacl-60f26d647ceccea5d0ab0bf85b35b492886bf451.tar.gz caffeonacl-60f26d647ceccea5d0ab0bf85b35b492886bf451.tar.bz2 caffeonacl-60f26d647ceccea5d0ab0bf85b35b492886bf451.zip |
SetTotalBytesLimit to the max (2 GB minus 1 byte)
Diffstat (limited to 'src')
-rw-r--r-- | src/caffe/util/io.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/caffe/util/io.cpp b/src/caffe/util/io.cpp index ffdaeb12..6fa6e680 100644 --- a/src/caffe/util/io.cpp +++ b/src/caffe/util/io.cpp @@ -17,6 +17,8 @@ #include "caffe/proto/caffe.pb.h" #include "caffe/util/io.hpp" +const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 byte. + namespace caffe { using google::protobuf::io::FileInputStream; @@ -50,7 +52,7 @@ bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { CHECK_NE(fd, -1) << "File not found: " << filename; ZeroCopyInputStream* raw_input = new FileInputStream(fd); CodedInputStream* coded_input = new CodedInputStream(raw_input); - coded_input->SetTotalBytesLimit(1073741824, 536870912); + coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); bool success = proto->ParseFromCodedStream(coded_input); |