我正在尝试实现此代码,该代码从
官方 tensorflow 数据集中加载数据,以使其加载放置在我的谷歌驱动器上的数据
dataset, metadata = tfds.load('cycle_gan/horse2zebra',
with_info=True, as_supervised=True)
train_horses, train_zebras = dataset['trainA'], dataset['trainB']
我怎样才能让它将我的图像加载到从 A 类和 B 类到我的 train_horses 和 train_zebras 类的类中
train_dataset=tf.keras.utils.image_dataset_from_directory(
'/content/drive/MyDrive/ColorGan', labels='inferred', label_mode='int',
class_names=None, color_mode='rgb', batch_size=32, image_size=(256,
256), shuffle=True, seed=2000, validation_split=0.2, subset='training',
interpolation='bilinear', follow_links=False,
crop_to_aspect_ratio=False)
test_dataset=tf.keras.utils.image_dataset_from_directory(
'/content/drive/MyDrive/ColorGan', labels='inferred', label_mode='int',
class_names=None, color_mode='rgb', batch_size=32, image_size=(256,
256), shuffle=True, seed=2000, validation_split=0.2, subset='validation',
interpolation='bilinear', follow_links=False,
crop_to_aspect_ratio=False)
train_horses, train_zebras = train_dataset['A'],train_dataset['B']
它给了我一个错误,它不是可编写脚本的,我可以怎样才能以顶部代码片段中显示的格式加载数据