How can I add a class to a .PT file that I previously Trained?

Hello, my name is Ta . I am currently studying Yolov5.

I’m having a problem similar to this person. : https://community.ultralytics.com/t/added-a-new-class-to-a-pre-trained-model-and-model-completely-forgets-the-previous-class/30

I only have a model file

I have changed the index in the labels folder to
– bus [2]
– bicycle [3]

When I train with the command

!python train.py --img 640 --batch 16 --epochs 170 --data new/data.yaml --weights yolov_person.pt

[ yolov_person.pt ] is the filename of the original model to which the class is to be added.

The result is that I can detect class “bus”,“bicycle” but not detect class “person”,“car”.

I don’t think that is possible or if it is, it’ll require some changes to the yolov5 core modules. Labels should follow the standard yolov5 format. See custom training tutorial for more info -Train Custom Data · ultralytics/yolov5 Wiki · GitHub