root
root

Reputation: 59

How to convert a saved Keras .h5 file to csv file or .mat file

I trained a classifier model using keras then I saved the architecture of the model in a H5 file and the weights in Json file. I was wondering how can I convert the H5 file into any other file like .csv or .mat? And how can I load after that the model architecture with these files?

Upvotes: 0

Views: 2816

Answers (1)

drum
drum

Reputation: 5651

http://curlybrackets.co/blog/2017/06/06/using-python-dump-hdf5-h5-files-csv/

import pandas as pd

with pd.HDFStore('myfile.h5', 'r') as d:
    df = d.get('TheData')
    df.to_csv('myfile.csv')

Upvotes: 1

Related Questions