From e43c079fc33a197942d73a57250d09a26cbb2fab Mon Sep 17 00:00:00 2001 From: Jeff Donahue Date: Tue, 30 Sep 2014 12:32:34 -0700 Subject: [PATCH] hdf5_load_nd_dataset_helper: check that dataset exists first --- src/caffe/util/io.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/caffe/util/io.cpp b/src/caffe/util/io.cpp index 4a22e18..43e5c01 100644 --- a/src/caffe/util/io.cpp +++ b/src/caffe/util/io.cpp @@ -124,6 +124,9 @@ template void hdf5_load_nd_dataset_helper( hid_t file_id, const char* dataset_name_, int min_dim, int max_dim, Blob* blob) { + // Verify that the dataset exists. + CHECK(H5LTfind_dataset(file_id, dataset_name_)) + << "Failed to find HDF5 dataset " << dataset_name_; // Verify that the number of dimensions is in the accepted range. herr_t status; int ndims; -- 2.7.4