Evolving-AI-Lab / fooling

Code base for "Deep Neural Networks are Easily Fooled" CVPR 2015 paper
171 stars 59 forks source link

ImageDataLayer: Check failed: num_images <= batch_size (10 vs. 1) #7

Closed ambarpal closed 8 years ago

ambarpal commented 8 years ago

I was attempting to reproduce the results of your excellent paper on my dataset, and set up the environment as mentioned in the guide. However, on running the given experiment with ./build/default/exp/images/images 1 caffe throws the error image_data_layer.cpp:328] Check failed: num_images <= batch_size (10 vs. 1) The number of added images 10 must be no greater than the batch size 1

This happens both on the using the provided prototxt file as well as on my model. Is the value 10 hardcoded somewhere? I figured that vector<cv::Mat>& images being passed to AddImagesAndLabels in image_data_layer.cpp is of size 10, but cannot determine from where the function is being called.

layers {
  name: "data"
  type: IMAGE_DATA
  top: "data"
  top: "label"
  image_data_param {
    source: "/home/ambar/Dropbox/code/prev-paper-1/fooling/sferes/exp/images/gtsrb/labels.txt"
    mean_file: "/home/ambar/Dropbox/code/prev-paper-1/fooling/sferes/exp/images/gtsrb/mean.binaryproto"
    batch_size: 1
    new_height: 32
    new_width: 32
    images_in_color: false
  }
}
layers {
  name: "conv1"
[.......................] other layers
}

labels.txt:

/home/ambar/Dropbox/code/prev-paper-1/fooling/sferes/exp/images/gtsrb/20.png 1
ambarpal commented 8 years ago

I had not properly modified the Parameters passed to caffe in dl_images.hpp which was causing the error. But now running on GPU mode gives segmentation fault, whereas the experiment runs fine in CPU mode.