-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not load pertrained weights in VGG19 #1022
Comments
I use pip installing the TL2 and the version is the latest 2.1.0. |
same problem. and my version is the latest 2.1.1. |
About vgg16 and vgg19The pretrained weights of VGG16 and VGG19 are in different encodings which causes the different loading code in TL source code. if layer_type == 'vgg16':
npz = np.load(os.path.join('models', model_saved_name[layer_type]))
...
elif layer_type == 'vgg19':
# npz = np.load(os.path.join('models', model_saved_name[layer_type]), encoding='latin1').item()
npz = np.load(os.path.join('models', model_saved_name[layer_type]), encoding='latin1', allow_pickle=True).item()
... Now I think you know why VGG16 works well. If you have downloaded the pretrained weights of VGG19 but failed to loading, please change the TL code tensorlayer/models/vgg.py in python site-packages as shown upper. About downloading errorIf you are in China might cause some TIMEOUT error. I suggest you to try more because I did it and I am in China.
|
New Issue Checklist
Issue Description
When I use VGG19 model with pretrained weights, some errors arose. Maybe it is mismatching of
numpy and tensorlayer2 that cause the problem. The weight download process works well.
Reproducible Code
Here is the error:
The text was updated successfully, but these errors were encountered: