首页 > 解决方案 > Keras 无法下载任何东西

问题描述

我正在尝试和测试 TF-2.0 几天。Keras或者tensorflow_datasets甚至无法下载任何东西,例如数据或预训练模型。比如我想下载MobileNetV2的预训练模型。

# Create the base model from the pre-trained model MobileNet V2

base_model = tf.keras.applications.MobileNetV2(input_shape=IMG_SHAPE,
                                               include_top=False,
                                               weights='imagenet')

当我运行代码时,程序无法从互联网上获取文件。

Downloading data from https://github.com/JonathanCMitchell/mobilenet_v2_keras/releases/download/v1.1/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_160_no_top.h5

对于图像等其他资源,我从 Colab 手动下载资源文件并将其复制到~/tensorflow_datasets/cats_vs_dogs/2.0.1. 这是工作。

我的运行环境:

标签: pythontensorflowkeras

解决方案


推荐阅读