Reputation: 81
I am going through vgg16 model and saw this:
model = VGG16(weights='imagenet')
and
model = VGG16()
Upvotes: 0
Views: 103
Reputation: 33460
There is no difference between these two since according to the documentation the weights
argument by default is set to 'imagenet'
:
keras.applications.vgg16.VGG16(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000)
Therefore if you don't set this argument when instantiating the VGG16
class, it would be set to 'imagenet'
by default and therefore the ImageNet weights will be loaded.
However, if you like to just load the VGG16 model without any pre-trained weights, you can pass weights=None
when instantiating VGG16
class. Read the documentation on VGG16 for more info about the arguments.
Upvotes: 1