fchollet / deep-learning-models

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

Finetune ResNet meets error, please help me~ #54

Open Tristacheng opened 7 years ago

Tristacheng commented 7 years ago

488452559 841787571 1657741171

I finetuned vgg-16 on my datasets, it works correctly, but when I turns to ResNet50, just changed the model and the weights, but it reports error like above, it says there's dimension mismatched in the median part of model, I am disturbed by this problem. At present my computer can't connect to Internet, so I have to take photos, sorry for that. Keras version is 1.1.1, theano version is 0.8.2 and Ubuntu 14.04

mynameisfiber commented 7 years ago

I get the same error:

sc{border_mode='valid', subsample=(2, 2), conv_mode='conv', precision='float32'}.0, Constant{1.0}, Constant{0.0})
Toposort index: 1255
Inputs types: [CudaNdarrayType(float32, 4D), CudaNdarrayType(float32, 4D), CudaNdarrayType(float32, 4D), <theano.gof.type.CDataType obje
ct at 0x7ff74b980a90>, Scalar(float32), Scalar(float32)]
Inputs shapes: [(64, 3, 230, 230), (7, 7, 3, 64), (64, 7, 114, 84), 'No shapes', (), ()]
Inputs strides: [(158700, 52900, 230, 1), (1344, 192, 64, 1), (67032, 9576, 84, 1), 'No strides', (), ()]
Inputs values: ['not shown', 'not shown', 'not shown', <capsule object NULL at 0x7ff739d00090>, 1.0, 0.0]
Inputs type_num: ['', '', '', '', 11, 11]
Inputs name: ('image', 'kernel', 'output', 'descriptor', 'alpha', 'beta')

Outputs clients: [[GpuElemwise{add,no_inplace}(GpuDnnConv{algo='small', inplace=True}.0, GpuDimShuffle{x,0,x,x}.0)]]

keras version: 2.0.3 theano version: 0.9.0 python version: 3.6.1 OS: Ubuntu 16.04.2 LTS

Although, I get the same error with both the VGG16 and the ResNet50 models from this repo.

mynameisfiber commented 7 years ago

To those still struggling with this issue, I posted the fix on: https://github.com/fchollet/keras/issues/6029#issuecomment-295874341