Hi, how do we convert a hdf5 file to csv format using python?
In general, you can't just map directly to a single CSV file. The "H" in HDF5 stands for "hierarchical", so HDF5 data is actually tree-like. There is also metadata in HDF5 files that is not part of the arrays stored in the files.
Agreed... this is a very general question. I'd recommend getting used to NumPy, exporting some arrays to CSV, and then move on to h5py using the online user guide (docs.h5py.org.).
file = h5py.File('model.h5','r+')
dataset1 = file['/dense_1/dense_1/kernel'] // suppose kernel contains the weights
numpy.savetxt("dataset1.csv",dataset1)
Most helpful comment
file = h5py.File('model.h5','r+')
dataset1 = file['/dense_1/dense_1/kernel'] // suppose kernel contains the weights
numpy.savetxt("dataset1.csv",dataset1)