仍然下载甚至Keras有./keras/models中的VGG16预训练模型

时间:2017-08-27 14:47:44

标签: deep-learning keras

我尝试过运行VGG16 keras脚本。 我收到这个错误:

Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5
Traceback (most recent call last):
File "test_imagenet.py", line 40, in
model = VGG16(weights="imagenet")
File "/home/nvidia/deep-learning-models/imagenet-example/vgg16.py", line 143, in VGG16
cache_subdir='models')
File "build/bdist.linux-aarch64/egg/keras/utils/data_utils.py", line 222, in get_file
Exception: URL fetch failure on https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5:

我尝试从here手动下载并将其粘贴到~/.keras/models

但是,我仍然遇到同样的错误。为什么?我不理解错误,因为正确的模型已经在.keras/models

1 个答案:

答案 0 :(得分:2)

<body> <div class="container"> <div class="body"> <div class="content"> <div class="ribbon">STUFF<br>BLAH</div> <!-- there is actually a bunch of other stuff in between "content" and "inner"--> <div class="inner"> content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content <br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> </div> </div> </div> <div class="footer">footer</div> </div> </body>函数中include_top参数的默认值为VGG16。这意味着如果您想使用全层预训练的VGG网络(具有完全连接的部分),您需要下载True文件,而不是vgg16_weights_tf_dim_ordering_tf_kernels.h5