小编Emr*_*dik的帖子

输入数据集和输出数据集的 Tensorflow image_dataset_from_directory

我正在尝试学习图像自动编码,但我无法使用输入和输出图像来训练模型

例如:输入图像文件夹:“.../Pictures/Input”
输出图像文件夹:“.../Pictures/Output”

#get input images from data_dir_input
ds_input = tf.keras.preprocessing.image_dataset_from_directory(
    data_dir_input,
    seed=123,
    image_size=(img_height, img_width),
    label_mode=None,
    batch_size=batch_size)

#get output images from data_dir_output
ds_output = tf.keras.preprocessing.image_dataset_from_directory(
    data_dir_output,
    seed=123,
    image_size=(img_height, img_width),
    label_mode=None,
    batch_size=batch_size)

# --------- model init etc --------------
# ...


model.fit(x=ds_input, y=ds_output, batch_size=32, epochs=50)

Run Code Online (Sandbox Code Playgroud)

但是我说这个错误:

`y` argument is not supported when using dataset as input

训练模型时如何使用自己的输入图像和输出图像?

python image-processing autoencoder keras tensorflow

5
推荐指数
1
解决办法
4982
查看次数