ValueError: Error when checking : expected flatten_1_input to have shape (None, 4, 4, 512) but got array with shape (1, 150, 150, 3)
问题 I followed the guide at this link to build a model and stopped before the finetuning part to test the model on some other images using the following code: img_width, img_height = 150, 150 batch_size = 1 test_model = load_model('dog_cat_model.h5') validation_data_dir = "test1" test_datagen = ImageDataGenerator(rescale=1. / 255) validation_generator = test_datagen.flow_from_directory( validation_data_dir, target_size=(img_width, img_height), batch_size=batch_size, shuffle=False, class_mode=