AttributeError when using Strong Sort tracker in TorchYOLO
When attempting to use the Strong Sort tracker with the TorchYOLO framework, users encounter an AttributeError. The error occurs when executing the following command:
torchyolo tracker --config_path torchyolo/configs/default_config.yaml --model_type yolov5 --model_path yolov5s.pt --tracker_config_path torchyolo/configs/tracker/strong_sort.yaml --source yl.mp4 Error Message: YOLOv5 2024-3-25 Python-3.8.19 torch-1.13.0+cpu CPU
Fusing layers...
Model summary: 214 layers, 7022326 parameters, 0 gradients, 15.9 GFLOPs
Adding AutoShape...
Traceback (most recent call last):
File "C:\Users\elkis\anaconda3\envs\env2\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\elkis\anaconda3\envs\env2\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\elkis\anaconda3\envs\env2\Scripts\torchyolo.exe_main.py", line 7, in
Can you share your code?
@kadirnar I'm just using this command line: :
torchyolo tracker --config_path torchyolo/configs/default_config.yaml
--model_type yolov5 --model_path yolov5s.pt
--tracker_config_path norfair.yaml
I'm using my custom YOLOv5 model specified here: --model_path yolov5s.pt, which is originally best.pt, but I renamed it to yolov5s.
The problem arises when I use --tracker_config_path norfair.yaml with a strong_sort or any other tracker. I encounter this error:
tracker_module = create_tracker(
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\torchyolo\tracker\tracker_zoo.py", line 79, in create_tracker
distance_function=config.NORFAIR_TRACK.DISTANCE_FUNCTION,
AttributeError: 'YamlParser' object has no attribute 'NORFAIR_TRACK'