fchollet / deep-learning-models

Keras code and weights files for popular deep learning models.
MIT License
7.32k stars 2.46k forks source link

Troubles when using pretrained model for ResNet50 on Keras #92

Open RyinSuh opened 6 years ago

RyinSuh commented 6 years ago

I downloaded my network architecture from here: https://github.com/flyyufelix/cnn_finetune If I train resnet_50.py on my own data while using pretrained model resnet50_weights_tf_dim_ordering_tf_kernels.h5 the error message will be like this: ValueError: Dimension 0 in both shapes must be equal, but are 1 and 512 for 'Assign_78' (op: 'Assign') with input shapes: [1,1,128,512], [512,256,1,1]. But if I quit using pretrained model the script will run just fine and the training accuracy will be incredibly low (around 10%), so is training loss. What should I do?

ninghongbo123 commented 5 years ago

I have the question as same as you meet? Have you found out this reasons?

frozenbeanxxx commented 5 years ago

maybe you should download https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels.h5 when i use v0.1, i have the same problem with you

tomwuu commented 5 years ago

hey, the url is not existing now, do you know where i can find the Version_2 pre-trained weights?

XingLiangLondon commented 5 years ago

Hi, I found that after successfully run "Classify images" (codes in README.md), weights of ResNet50 has been auto downloaded. And you could find the downloaded weights at: C:\Users\username \.keras\models\

mrd05 commented 4 years ago

https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5