Created
August 1, 2019 21:14
-
-
Save shubhamagarwal92/ca3d4974c01825439a92e3403aba13b7 to your computer and use it in GitHub Desktop.
Save h5 data in a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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