python - 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
. 这是工作。
我的运行环境:
- Ubuntu 19.04
- Python 3.7.3
- 仅 TensorFlow CPU
解决方案
推荐阅读
- python - Python:从另一个类调用派生类方法
- python - Python FileNotFoundError: [Errno 2] 尽管给出了完整的文件路径
- python - 尽管它是正确的,但 Spotify 发布请求会向我抛出“无效凭据”错误
- java - thymeleaf 和 spring boot 应用程序中未显示表单验证错误
- android - 当页面之一包含折叠工具栏并且 fitSystemWindows 为真时,Android BottomNavigationBar 移动
- r - 当 # of Obs 大于 26 时,二进制排列表变得太大
- python - 在 Moto 中使用 Boto3(1.8 或更高版本)时如何模拟 AWS 调用
- jquery - 如何使用当前 gif 制作预加载器背景以适应整个页面?
- r - 确定栅格堆栈中的哪个图层首先满足条件?
- mysql - 无法使用 awk 将数据插入 mysql 数据库