summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b20394)
raw | patch | inline | side by side (parent: 4b20394)
author | Yangqing Jia <jiayq84@gmail.com> | |
Thu, 28 Nov 2013 01:00:00 +0000 (17:00 -0800) | ||
committer | Yangqing Jia <jiayq84@gmail.com> | |
Thu, 28 Nov 2013 01:00:00 +0000 (17:00 -0800) |
src/caffe/util/io.cpp | patch | blob | history |
diff --git a/src/caffe/util/io.cpp b/src/caffe/util/io.cpp
index 9e2bdf54b650970b502dba513606036c750751e4..a6b401b93b570cc92298ca52e2a835c7c36ca72f 100644 (file)
--- a/src/caffe/util/io.cpp
+++ b/src/caffe/util/io.cpp
void ReadProtoFromTextFile(const char* filename,
::google::protobuf::Message* proto) {
int fd = open(filename, O_RDONLY);
+ CHECK_NE(fd, -1) << "File not found: " << filename;
FileInputStream* input = new FileInputStream(fd);
CHECK(google::protobuf::TextFormat::Parse(input, proto));
delete input;
void ReadProtoFromBinaryFile(const char* filename, Message* proto) {
int fd = open(filename, O_RDONLY);
+ CHECK_NE(fd, -1) << "File not found: " << filename;
ZeroCopyInputStream* raw_input = new FileInputStream(fd);
CodedInputStream* coded_input = new CodedInputStream(raw_input);
coded_input->SetTotalBytesLimit(536870912, 268435456);