TypeError: tuple indices must be integers or slices, not list - While loading a model Keras
问题 In short, i have 2 trained models, one trained on 2 classes, the other on 3 classes. My code loads a model, loads an image, and predicts a classification result. finetune_model = tf.keras.models.load_model(modelPath) model = load_model(my_file) img = image.load_img(img_path, target_size=(img_width, img_height)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) preds = model.predict(x) The model file is of .h5 type. When loading the 2-class trained model, it