Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use models from Keras Applications without pretrained weights

Keras Applications provide implementations of some of the most popular model architectures with weights pretrained on some of the most popular datasets. These predefined models are very handy for transfer learning of problems which are similar to the datasets the models were trained on.

But what if I have a very different problem and want to completely train the models on the new dataset? How can I use the models in Applications for training from scratch based on my own dataset, if I dont have pretrained weights?

like image 907
user1934212 Avatar asked Oct 15 '25 04:10

user1934212


1 Answers

You can assign a None to the weights variable, for instance with the inception V3 architecture.

keras.applications.inception_v3.InceptionV3(include_top=False, weights='None', input_shape=input_shape = (img_width, img_height, 3))



include_top=False will allow you to train the top layer with your custom network.

weights='None' means that we are training without any weights if you want to train using imagenet weight you set it to weights='imagenet'

like image 70
Simbarashe Timothy Motsi Avatar answered Oct 18 '25 04:10

Simbarashe Timothy Motsi