Open shigeomi-t opened 1 month ago
Did you try benchmarking it after reparametrization (with detect.py)? Also if you ran the S version first, the images may have been cached in memory for the C run, depending on disk random access speed, it may be more substantial than the model difference.
I think some layers in T and S are relatively deeper compared to M and upwards, which may result in heavier auxiliary branches. Before reparametrization, it will still be using these parameters.
@guillermo-gabrielli-fer Thank you for your advice.
I cached model loaded and also put all the images in memory and then ran the detection, but Yolov9-s was slower.
This may be unrelated, but when I tried reparameterization, which is provided in this repository, I could not do it because of an error.
reparameterization code
tools/reparameterization.ipynb Convert YOLOv9-S
Error raised
model.21.cv4.bn.num_batches_tracked perfectly matched!! Traceback (most recent call last): File "reparameterization.py", line 24, in
model.state_dict()[k] += ckpt['model'].state_dict()[kr] KeyError: 'model.32.cv4.0.cv1.conv.weight'
I have no way to resolve this issue. Can someone please advise me?
I trained models with my custom dataset. Yolov9-s model trained with my custom dataset is slower to detect than Yolov9-c trained with my custom dataset.
Execution command
python detect_dual.py --source my_test_dataset_folder --img 448 --device 0 --weights path_to_my_model --name= my.yaml
Yolov9-s should be faster, but this is the result. Why is this? How can I speed up the detection of Yolov9-s?