0

For transfer learning I am using a ResNet50 model pre trained on ImageNet. After removing the last layer I want to use outputs of the layer before the last layer (as the last layer is removed by making top = False) as a feature extractor to train a Logistic Regression classifier. I got this UserWarning (mentioned in the question's title) for the line below:

model = ResNet50(weights='imagenet', include_top = False)

Why this is happening?

hafiz031
  • 2,236
  • 3
  • 26
  • 48

3 Answers3

0

I got the same problem after giving the "include_top = False". Then first I set "incude_top = True", the dataset is downloaded. After that, I set the "include_top = False", the dataset is downloaded and there is no error.

0

According to keras official site: resnet50-function

You can simply use ResNet50 directly from application class, like that:

from keras.applications import ResNet50

model = ResNet50(weights='imagenet', include_top = False)

Kassem
  • 1
  • 2
-1
base_model = ResNet50(include_top=False,weights='imagenet',input_shape = (224,224,3),pooling='avg')

Set the pooling='avg' or 'max'

You can see it in the code from resnet50.py if you go to the warning link

David Buck
  • 3,752
  • 35
  • 31
  • 35
Dean
  • 1