Open haxxolotl opened 3 years ago
Did you figure out anything?
Did you figure out anything?
No, but I guess I have what I needed lol
because the shape of weights of the detection layers are different, they will be re-initialize by default.
in this case, to simplify the problem, i suggest you to append pseudo label of coco classes to your own label in your custom dataset.
(the better way is copy weights of original 80 classes to new weights, and do transfer/incremental learning on the new class.)
This is my steps so far:
classes=80
toclasses=81
, changing allfilters=255
tofilters=258
nc: 80
tonc:81
, and adding a name tonames: []
(i.e., empty shelf)yolor_w6.pt
python train.py --batch-size 4 --img 1280 1280 --data my_yaml.yaml --cfg cfg/my_config.cfg --weights yolor_w6.pt --device 0 --name my_run --hyp hyp.scratch.1280.yaml --epochs 30
python detect.py --source inference/images/ --cfg cfg/my_config.cfg --weights runs/train/my_run/weights/last_029.pt --conf 0.2 --img-size 1280 --device 0 --names data/my_namesl.names
The output does indeed show my image classes being detected, but all the other ones are gone? I couldn't find any resources for proper steps for extending the model, so any help/correction with the above steps is appreciated
example non extended model inference:
example attempted extended model inference, with desired "refrigerator" class missing: