How to extract the size of the input image from an H5 file

Viewed 52

I created and ran a CNN model where the size of the input images are (64x64x3).

I would like to know if it is possible to extract this information from the H5 files (weight or model) I got using model.save_weights("****.h5") and model.save("****.h5").

1 Answers

You can use h5py library to read .h5 files For installing - pip install h5py

import h5py
f = h5py.File('model.h5', 'r')
one_data = f['key']
print(one_data.shape)
Related