Imagenet上VGG和ResNet模型参数下载方法与链接

如果ubuntu有科学上网工具的话可以直接用以下代码导入

#tensorflow2.0
model = keras.applications.VGG19(weights='imagenet', include_top=False,
                               pooling='max')#这里的参数可根据自己需要修改

没有的话考虑用下面的链接先从其他地方下载,再导入包内

注意本文是tensorflow的版本是2.0,不过1.*版本也应该可以用下载下来后是个.h5文件,ubuntu导入方法可以参考我的另一篇博客

链接分两种分别对应include_top=True和False

VGG16

WEIGHTS_PATH = ('https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5')#500MB
WEIGHTS_PATH_NO_TOP = ('https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5')#50MB

VGG19

WEIGHTS_PATH = ('https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg19_weights_tf_dim_ordering_tf_kernels.h5')
WEIGHTS_PATH_NO_TOP = ('https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg19_weights_tf_dim_ordering_tf_kernels_notop.h5')

ResNet50

WEIGHTS_PATH = ('https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels.h5')
WEIGHTS_PATH_NO_TOP = ('https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5')

你可能感兴趣的:(Deep,Learning)