from keras.applications import VGG16

conv_base = VGG16(weights='imagenet',
                  include_top=False,
                  input_shape=(150, 150, 3))

。下载VGG16网络时出现错误

Exception: URL fetch failure on https://storage.googleapis.com/
tensorflow/keras-applications/vgg16/
vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5:
 None -- [Errno 2] No such file or directory

下载需要一点科学手段。重新运行代码,之后就没问题了。

58889256/58889256 [==============================] - 9s 0us/step

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐