我有一个自动编码器写在Keras,如下所示。但是,我有以下错误:ValueError: Error when checking model input: the list of Numpy arrays
that you are passing to your model is not the size the model expected.
Expected to see 1 arrays but instead got the following list of 374 arrays
前提是374是我的训练图像的数量。在
在这种情况下,如何根据数据训练自动编码器?在
^{pr2}$
谢谢。在
编辑
我添加了以下内容而不是for循环:training_generator = ImageDataGenerator()
validation_generator = ImageDataGenerator()
training_images = training_generator.flow_from_directory(training_directory, class_mode='input')
validation_images = validation_generator.flow_from_directory(validation_directory, class_mode='input')
但是,得到了以下信息:TypeError: Error when checking model input: data should be a Numpy
array, or list/dict of Numpy arrays. Found
...
这句话发生了什么:autoencoder.fit(
training_images,
epochs=10,
batch_size=20,
shuffle=True,
validation_data=validation_images)
有什么想法吗?在