In several Kaggle kernels I've seen that people often import their weights into Keras' DenseNet. In the following case, I believe the weights are sourced from this github repo and contain the pre-trained weights on the ImageNet dataset.

densenet = DenseNet121(

Why do people load weights from a file when you can use the ImageNet weights within Keras by specifying weights='imagenet' in the following manner?

keras.applications.densenet.DenseNet121(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000)

Is there a difference that I should be aware of or is it simply a matter of personal preference?


Because it must have been a kernel only competition, with: 'the following conditions must be met:"Internet must be turned off".'

When we use " weights='imagenet' " , the notebook will connect to internet to download the weights. Since the user cannot connect to internet for that particular competition it is better to upload the weights as data source, and then import it for use.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.