deep-learning-models icon indicating copy to clipboard operation
deep-learning-models copied to clipboard

Inveption V3 weights loading problem

Open zw615 opened this issue 7 years ago • 4 comments

this code: model=InceptionV3(include_top=False, weights='imagenet', input_tensor=None, input_shape=None, pooling=None) always return this error

Exception: URL fetch failure on https://github.com/fchollet/deep-learning-models/releases/download/v0.5/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5: None -- [Errno 10060]

So I want to manully download the weight file and use the model.load_weights method. However for keras 2 there are only TF weight file . I am using Theano 0.9.0 as backend. Is there any way to load inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5 while using Theano?

Also , How to fix this URL fetch failure

zw615 avatar Apr 10 '17 06:04 zw615

Also , I see the source code of InceptionV3. I found this function

convert_all_kernels_in_model

And I use it before load weight model=InceptionV3(include_top=False, weights=None, input_tensor=None, input_shape=None, pooling=None) convert_all_kernels_in_model(model) model.load_weights(weight_path+'/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5')

However, it still returns:

TypeError: Indexing elements must be in increasing order

zw615 avatar Apr 10 '17 06:04 zw615

Now I can download weight from https://github.com/fchollet/deep-learning-models/releases/download/v0.5/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5: But I still get:

TypeError: Indexing elements must be in increasing order

zw615 avatar Apr 10 '17 10:04 zw615

My solution for Mac OS X:

  1. Upgrade to Python 3.6.5 using the native app Python installer downloaded from the official Python language website https://www.python.org/downloads/

I've found that this installer is taking care of updating the links and symlinks for the new Python a lot better than homebrew.

  1. Install a new certificate using "./Install Certificates.command" which is in the refreshed Python 3.6 directory

cd "/Applications/Python 3.6/" sudo "./Install Certificates.command"

ClaudeCoulombe avatar Apr 21 '18 08:04 ClaudeCoulombe

Great! Thanks a lot!

jojolueken avatar Jul 22 '19 12:07 jojolueken