Python Keras不能下载任何东西

Python Keras不能下载任何东西,python,tensorflow,keras,Python,Tensorflow,Keras,我正在尝试和测试TF-2.0几天Keras或tensorflow_数据集无法下载任何内容,即使是数据或列车前模型。例如,我想对MobileNet V2的预训练模型进行降级 # Create the base model from the pre-trained model MobileNet V2 base_model = tf.keras.applications.MobileNetV2(input_shape=IMG_SHAPE,

我正在尝试和测试TF-2.0几天
Keras
tensorflow_数据集
无法下载任何内容,即使是数据或列车前模型。例如,我想对MobileNet V2的预训练模型进行降级

# 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')
当我运行代码时,程序无法从internet获取文件

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
对于另一个资源,如image,我从Colab手动下载资源文件,并将它们复制到
~/tensorflow\u datasets/cats\u vs\u dogs/2.0.1
。这是工作

我的运行时环境:

  • Ubuntu 19.04
  • Python 3.7.3
  • 仅限Tensorflow CPU

  • h5py
    软件包是否安装在相同的python环境中?可能是下载了.h5文件,但代码无法读取。您是否收到任何错误消息?或者你是如何确定它不工作的?h5py软件包是由Ubuntu安装的。当我用Tensorflow的任何下载操作运行我的代码时,程序将停止很长一段时间,没有任何消息。我已通过将通过浏览器下载的模型文件*.h5复制到Keras
    ~/.Keras/models
    的默认目录中,解决了此问题。