from tensorflow.python.keras.applications.vgg16 import VGG16
model=VGG16()
第二步:读入图片,并把图片转换成数组格式
from tensorflow.python.keras.applications.image import load_img
from tensorflow.python.keras.applications.image import img_to_array
img=load_img("filepath",target_size=(224,224))
img=img_to_array(img)
第三步:图片的预处理
from tensorflow.python.keras.applications.vgg16 import preprocess_input
img=img.reshape(1,img.shape[0],img.shape[1],img.shape[2])
img=preprocessing_input(img)