Check input line count in HDF5 data layer
authorJonathan Ho <hoj@cs.stanford.edu>
Thu, 11 Dec 2014 02:27:56 +0000 (18:27 -0800)
committerJonathan Ho <hoj@cs.stanford.edu>
Thu, 11 Dec 2014 02:52:08 +0000 (18:52 -0800)
src/caffe/layers/hdf5_data_layer.cpp

index f6865ef..706c4a1 100644 (file)
@@ -75,6 +75,8 @@ void HDF5DataLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
   num_files_ = hdf_filenames_.size();
   current_file_ = 0;
   LOG(INFO) << "Number of HDF5 files: " << num_files_;
+  CHECK_GE(num_files_, 1) << "Must have at least 1 HDF5 filename listed in "
+    << source;
 
   // Load the first HDF5 file and initialize the line counter.
   LoadHDF5FileData(hdf_filenames_[current_file_].c_str());