- How To Import The MNIST Dataset From Local Directory Using PyTorch
- how to split up tf.data.Dataset into x_train, y_train, x_test, y_test for keras
- How to plot confusion matrix for prefetched dataset in Tensorflow
- How to Use Class Weights with Focal Loss in PyTorch for Imbalanced dataset for MultiClass Classification
- How to solve "ValueError: y should be a 1d array, got an array of shape (3, 5) instead." for naive Bayes?
- How to create image of confusion matrix in Python
- What are the numbers in torch.transforms.normalize and how to select them?
- How to assign a name for a pytorch layer?
- How to solve dist.init_process_group from hanging or deadlocks?
- How to use sample weights with tensorflow datasets?
- How to Fine-tune HuggingFace BERT model for Text Classification
- How to Convert Yolov5 model to tensorflow.js
- Machine Learning Project: Hotel Booking Prediction [Part 2]
- Machine Learning Project: Airline Tickets Price Prediction
- Machine Learning Project: Hotel Booking Prediction [Part 1]
- Machine Learning Project Environment Setup
- Computer vision final year project ideas and guidelines
- Build Your First Machine Learning Project in Python(Step by Step Tutorial)
- Virtual assistant final year project ideas and guidelines
- Self-driving car github repositories and projects
How to train new classes on pretrained yolov4 model in darknet
The conventional way to train new classes on the pretrained YOLO4 model in Darknet is by implementing each classifier with its corresponding weights. Thus, the conventional way sets the Weight attribute on the IO connector for this new class.
One need to configure different yolov4 models according to different input_targets of new classes, do not erase old configurations of old models, keep original configuration of new class models for share parameters.
How to train new classes on pretrained yolov4 model in darknet
Solution 1:
You can't insert new classes in a trained model. When you trained using only the fire and smoke dataset, your config were not configured for 2 classes, but for 5 instead. Probably it's why you didn't get anything in your second test.
The model does not forget, but uses that weight as a head start for your new model. Just train again with a dataset containing all categories labelled.
Solution 2:
From the procedure that YOLO follows in training, any further training will enhance and modify the currently layers, so if you added new classes and retrained, you will enhance the exiting one and create new classes from scratch, which means not all classes will be the same during detection. I think the safest way is to train all from scratch.
Thank you for reading the article.