Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when using Strong Sort tracker in TorchYOLO #70

Open
userkw opened this issue Mar 25, 2024 · 2 comments
Open

AttributeError when using Strong Sort tracker in TorchYOLO #70

userkw opened this issue Mar 25, 2024 · 2 comments

Comments

@userkw
Copy link

userkw commented Mar 25, 2024

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
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\torchyolo\cli.py", line 10, in app
Fire(torchyolo_app)
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\fire\core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\fire\core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\torchyolo\predict.py", line 88, in tracker_predict
result = model.tracker_predict(
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\torchyolo\predict.py", line 56, in tracker_predict
tracker_prediction = self.model.tracker_predict(
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\torchyolo\modelhub\yolov5.py", line 78, in tracker_predict
tracker_module = load_tracker_module(
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\torchyolo\tracker\tracker_module.py", line 18, in load_tracker_module
tracker_module = load_tracker(
File "C:\Users\elkis\anaconda3\envs\env2\lib\site-packages\torchyolo\tracker\tracker_zoo.py", line 148, in load_tracker
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'

@kadirnar
Copy link
Owner

Can you share your code?

@userkw
Copy link
Author

userkw commented Mar 26, 2024

@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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants