我正在尝试实现从
加载数据的代码
官方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_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']
它给了我一个错误,即它不可编写脚本。我能做些什么,以便以顶部代码段中显示的格式加载数据
创建Tensorflow数据管道的示例工作代码
相关问题 更多 >
编程相关推荐