import keras import numpy as np from keras.applications import vgg16,
inception_v3, resnet50, mobilenet #Load the VGG model vgg_model =
vgg16.VGG16(weights='imagenet') #Load the Inception_V3 model inception_model =
inception_v3.InceptionV3(weights='imagenet') #Load the ResNet50 model
resnet_model = resnet50.ResNet50(weights='imagenet') #Load the MobileNet model
mobilenet_model = mobilenet.MobileNet(weights='imagenet')

在以上代码中,我们首先import各种模型对应的module,然后load模型,并用ImageNet的参数初始化模型的参数。如果不想使用ImageNet上预训练到的权重初始话模型,可以将各语句的中'imagenet'替换为'None'。

参考:

https://www.learnopencv.com/keras-tutorial-using-pre-trained-imagenet-models/

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信