die on inputs to IMAGE_DATA that fail to load
authorEvan Shelhamer <shelhamer@imaginarynumber.net>
Fri, 6 Feb 2015 00:41:46 +0000 (16:41 -0800)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Fri, 6 Feb 2015 00:46:51 +0000 (16:46 -0800)
It's better to know than march silently on.

src/caffe/layers/image_data_layer.cpp

index ef6a342..1366948 100644 (file)
@@ -118,10 +118,8 @@ void ImageDataLayer<Dtype>::InternalThreadEntry() {
     timer.Start();
     CHECK_GT(lines_size, lines_id_);
     cv::Mat cv_img = ReadImageToCVMat(root_folder + lines_[lines_id_].first,
-                                    new_height, new_width, is_color);
-    if (!cv_img.data) {
-      continue;
-    }
+        new_height, new_width, is_color);
+    CHECK(cv_img.data) << "Could not load " << lines_[lines_id_].first;
     read_time += timer.MicroSeconds();
     timer.Start();
     // Apply transformations (mirror, crop...) to the image