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

Troubles when using pretrained model for ResNet50 on Keras

Open RyinSuh opened this issue 6 years ago • 5 comments

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?

RyinSuh avatar Mar 14 '18 14:03 RyinSuh

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

ninghongbo123 avatar Dec 10 '18 08:12 ninghongbo123

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

frozenbeanxxx avatar Apr 02 '19 11:04 frozenbeanxxx

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

tomwuu avatar Jun 20 '19 14:06 tomwuu

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\

XingLiangLondon avatar Jul 03 '19 15:07 XingLiangLondon

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

mrd05 avatar Feb 29 '20 20:02 mrd05