I wanted to convert my pickle file to .h5 file and this was saved from a generator model. But it shows error.

code:

import pickle
import h5py

def convert_pickle_to_h5(pickle_file, h5_file):
\#Load data from pickle file
with open('/content/generator_model.pkl', 'rb') as f:
data = pickle.load(f) # error line

Can anyone please solve this problem or provide me code to convert pickle file to .h5py file? Thanks in advance.

0

There are 0 best solutions below