2

I have saved my large array of images and their labels in HDF5 format using this link: Saving and loading a large number of images (data) into a single HDF5 file which gives me following keys.
list of datasets:

['test_img', 'test_labels', 'train_img', 'train_labels', 'train_mean', 'val_img', 'val_labels']  

Now, I want to provide training data and training labels to a convolutional neural network (VGG-16 or ResNet) for training purpose and also want to validate and test my result using CNN. How can I input my data from HDF5 file into CNN?

Dadep
  • 2,796
  • 5
  • 27
  • 40

1 Answers1

1

Have a look at this open-source project tftables.

This other thread also has a great detailed answer by mikkola, explaining how to use your own generator with the new Tensorflow Dataset API otherwise.

benjaminplanche
  • 14,689
  • 5
  • 57
  • 69
  • The first link seems to work out but I have one more question will hdf5 table files and h5py files be dealt similarly ? can i use same method for h5py as well? – Bushra KhaLid May 03 '18 at 18:11
  • I am not aware of differences between hdf5 files created with h5py and with other tools, so I'd say the method should work with both; but it should be easy to quickly verify. – benjaminplanche May 04 '18 at 09:24