在学习深度学习神经网络部分知识时,读取数据集中的内容进行学习。
此时突发奇想,想将h5数据集中的图片全都保存为jpg格式的图片。
这段代码是参考了一些博主所写的。以下是一个demo,是能够运行的。
import numpy as np
import matplotlib.pyplot as plt
import h5py
#h5py is a common package to interact with a dataset that is stored on an H5 file
import PIL
#读取数据集
def load_dataset():
train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
train_set_x_orig = np.array(train_dataset["train_set_x"][

最低0.47元/天 解锁文章
1222

被折叠的 条评论
为什么被折叠?



