title: Converting A folder of images into a .h5 file?
body: <p>Currently I am doing the deep learning course by Andrew NG in coursera. There they are opening the dataset of images from a <code>.h5</code> file. I would like to try the same approach for my own dataset: I want to convert a folder of images to a <code>.h5</code> file.</p>
  
  <p>I tried the following, but when I open the <code>train_x.h5</code> it is showing all entries as zeros.</p>
  
  <pre><code>h5_train = h5py.File("train_x.h5", 'w')
  h5_train.create_dataset("data_train", data=np.array(train_x))
  print(h5_train)
  h5_train.close()
  </code></pre>
  
  <p>Here <code>train_x</code> is an array  of <code>shape(270000,500)</code>, where first entry is the number of <code>pixels(300*300*3)</code> and second entry is number of images in the folder.</p>