You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just came here randomly. But I think I can answer your question:
When using a pretrained model in transfer learning, one should remove the top layer and replace it with another FC layer that has neurons at the size of the new task's class numbers. So in your case, using includeTop=True is wrong. You should remove the top layer by assigning includeTop to False and add a Dense layer with 2 neurons to the model. Then you need to retrain your network on the new dataset (and probably freeze all other layers).
I'm trying to do a binary classification with imagenet weights and set include_top=False and classes = 2, but I receive the following error message:
If using
weights
as imagenet withinclude_top
as true,classes
should be 1000I think that the condition ( if weights == 'imagenet' and classes != 1000) or the message is wrong. Which one is correct?
Thank you!
Tensorflow Version
Please replace this line with Tensorflow version you are using.
Keras Version
Please replace this line with Keras version you are using.
Keras-squeezenet Version
Please replace this line with Keras-squeezenet version you are using.
Bug reports:
Please replace this line with a brief summary of your issue AND if reporting a build issue include the link from:
Code Sample:
Please replace this line with a code sample to replicate the issue.
The text was updated successfully, but these errors were encountered: