Reputation: 69
Below i have snippet of python code for Resnet:
base_model = ResNet50(include_top=False, weights='imagenet')
What does include_top=False, weights='imagenet'
really mean and is for?
Upvotes: 1
Views: 473
Reputation: 1272
According to the documentation:
include_top
: whether to include the fully-connected layer at the top of the network.
weights
: one of None (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded.
The keyword include_top
was nicely explained in this post.
When it comes to weights
, setting it to imagenet
means using the ResNet50 architecture with ImageNet-trained weights.
You can use any other dataset for training and load resulting weights using this argument or just use random ones, though starting with pre-trained ImageNet might be a good idea.
Due to their transferability, networks pre-trained on ImageNet are often a good choice to start with.
Upvotes: 1