x and y can be no greater than 2-D, but have shapes (1,) and (1, 224, 224, 3)
问题 I am trying to visualize the prediction of VGG-16 for the cat image, Compute the top-5 scores (the 5 classes with the maximum probability), For each of these 5 scores, print the corresponding label and the corresponding probability. from keras.applications.vgg16 import preprocess_input from keras.preprocessing import image # load the image from cat class and resize it img = image.load_img('cat.jpg', target_size=(224, 224)) # convert to numpy array of (224, 224, 3) x = image.img_to_array(img)