从 TensorFlow 教程中,我遇到了从 TensorFlow 数据集加载数据集的代码。
dataset, metadata = tfds.load('cycle_gan/horse2zebra',
with_info=True, as_supervised=True)
train_horses, train_zebras = dataset['trainA'], dataset['trainB']
test_horses, test_zebras = dataset['testA'], dataset['testB']
但是,我想加载不是来自 TensorFlow 数据集的我自己的数据集。在收集了我自己的数据集后,我不知道如何加载我的数据集并将其处理为与 TensorFlow tfds 相同的格式。
我的数据集文件夹也有相同的格式:trainA、trainB、testA、testB。