2017-08-27 154 views
0

中有VGG16預訓練模型我嘗試運行VGG16 keras腳本。 我得到這個錯誤:仍在下載甚至Keras在./keras/models

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

默認值include_top參數VGG16功能是True。這意味着如果您想要使用全層預培訓的VGG網絡(具有完全連接的部件),則需要下載vgg16_weights_tf_dim_ordering_tf_kernels.h5文件,而不是vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5