简体   繁体   中英

Can we train a pre-trained model with new data using tensorflow?

I have a trained model which can classify a cat or a dog as an h5 file named

catsvsdogs.h5

Now I want to add another animal in the list. Say I want to classify cat/dog/tiger using that model and I don't want to redo the training process of cat and dog, instead I want to feed the tiger data set in my neural network and then it will classify dog or cat or tiger with that same file. Is it possible to do so? If yes, how?

Unfortunately , this is not possible. You can of course train a model for tiger class but you would also need the dogs & cats data for making the model to classify between these 3 classes.

If you load this ( catsvsdogs.h5 ) pre-trained model for training on only tiger class you would have to set output layer with 1 class, so at the time of prediction it will only predict if it is tiger or not.

Retraining a trained model on only new class is still a research question.

这是不可能的,因为您的模型的结构方式可以将两个类中的一个分配给图像,您必须更改最外层并重新训练它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM