Skip to content

Instantly share code, notes, and snippets.

@shubhamagarwal92
Created August 1, 2019 21:14
Show Gist options
  • Save shubhamagarwal92/ca3d4974c01825439a92e3403aba13b7 to your computer and use it in GitHub Desktop.
Save shubhamagarwal92/ca3d4974c01825439a92e3403aba13b7 to your computer and use it in GitHub Desktop.
Save h5 data in a file
def save_h5_data(file_path, data_split="train", **data_dump):
hf = h5py.File(file_path, 'w')
hf.attrs['split'] = data_split
for key in data_dump:
hf.create_dataset(key, data=data_dump[key])
hf.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment