title: [caffe]: check fails: Check failed: hdf_blobs_[i]->shape(0) == num (200 vs. 6000)
body: <p>I have the train and label data as data.mat. (I have 200 training data with 6000 features and labels are (-1, +1) that have saved in data.mat).</p>
  
  <p>I am trying to convert my data in hdf5 and run Caffe using:</p>
  
  <pre><code>load data.mat
  hdf5write('my_data.h5', '/new_train_x', single( reshape(new_train_x,[200, 6000, 1, 1]) ) );
  hdf5write('my_data.h5', '/label_train', single( reshape(label_train,[200, 1, 1, 1]) ), 'WriteMode', 'append' );
  </code></pre>
  
  <p>And my layer.prototxt (just data layer) is:</p>
  
  <pre><code>layer {
    type: "HDF5Data"
    name: "data"
    top: "new_train_x"     # note: same name as in HDF5
    top: "label_train"     # 
    hdf5_data_param {
      source: "/path/to/list/file.txt"
      batch_size: 20
    }
    include { phase: TRAIN }
  }
  </code></pre>
  
  <p>but, i have an error:
  ( Check failed: hdf_blobs_[i]->shape(0) == num (200 vs. 6000))</p>
  
  <blockquote>
  <pre><code>I1222 17:02:48.915861  3941 layer_factory.hpp:76] Creating layer data
  I1222 17:02:48.915871  3941 net.cpp:110] Creating Layer data
  I1222 17:02:48.915877  3941 net.cpp:433] data -&gt; new_train_x
  I1222 17:02:48.915890  3941 net.cpp:433] data -&gt; label_train
  I1222 17:02:48.915900  3941 hdf5_data_layer.cpp:81] Loading list of HDF5 filenames from: file.txt
  I1222 17:02:48.915923  3941 hdf5_data_layer.cpp:95] Number of HDF5 files: 1
  F1222 17:02:48.993865  3941 hdf5_data_layer.cpp:55] Check failed: hdf_blobs_[i]-&gt;shape(0) == num (200 vs. 6000) 
  *** Check failure stack trace: ***
      @     0x7fd2e6608ddd  google::LogMessage::Fail()
      @     0x7fd2e660ac90  google::LogMessage::SendToLog()
      @     0x7fd2e66089a2  google::LogMessage::Flush()
      @     0x7fd2e660b6ae  google::LogMessageFatal::~LogMessageFatal()
      @     0x7fd2e69f9eda  caffe::HDF5DataLayer&lt;&gt;::LoadHDF5FileData()
      @     0x7fd2e69f901f  caffe::HDF5DataLayer&lt;&gt;::LayerSetUp()
      @     0x7fd2e6a48030  caffe::Net&lt;&gt;::Init()
      @     0x7fd2e6a49278  caffe::Net&lt;&gt;::Net()
      @     0x7fd2e6a9157a  caffe::Solver&lt;&gt;::InitTrainNet()
      @     0x7fd2e6a928b1  caffe::Solver&lt;&gt;::Init()
      @     0x7fd2e6a92c19  caffe::Solver&lt;&gt;::Solver()
      @           0x41222d  caffe::GetSolver&lt;&gt;()
      @           0x408ed9  train()
      @           0x406741  main
      @     0x7fd2e533ca40  (unknown)
      @           0x406f69  _start
  Aborted (core dumped)
  </code></pre>
  </blockquote>
  
  <p>Many thanks!!!! Any advice would be appreciated!</p>