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: 'DeepOCSort' object has no attribute 'reset' #1263

Closed
1 task done
adinathkale01 opened this issue Jan 18, 2024 · 6 comments
Closed
1 task done

AttributeError: 'DeepOCSort' object has no attribute 'reset' #1263

adinathkale01 opened this issue Jan 18, 2024 · 6 comments
Labels
question Further information is requested

Comments

@adinathkale01
Copy link

Search before asking

  • I have searched the Yolo Tracking issues and found no similar bug report.

Question

File "/home/advik/Desktop/Yolov5_StrongSORT_OSNet/examples/track.py", line 197, in
run(opt)
File "/home/advik/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/advik/Desktop/Yolov5_StrongSORT_OSNet/examples/track.py", line 103, in run
for frame_idx, r in enumerate(results):
File "/home/advik/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 35, in generator_context
response = gen.send(None)
File "/home/advik/.local/lib/python3.10/site-packages/ultralytics/engine/predictor.py", line 292, in stream_inference
self.run_callbacks("on_predict_postprocess_end")
File "/home/advik/.local/lib/python3.10/site-packages/ultralytics/engine/predictor.py", line 401, in run_callbacks
callback(self)
File "/home/advik/.local/lib/python3.10/site-packages/ultralytics/trackers/track.py", line 59, in on_predict_postprocess_end
predictor.trackers[i].reset()
AttributeError: 'DeepOCSort' object has no attribute 'reset'
terminate called without an active exception
Aborted (core dumped)

@adinathkale01 adinathkale01 added the question Further information is requested label Jan 18, 2024
@mikel-brostrom
Copy link
Owner

mikel-brostrom commented Jan 18, 2024

You cannot be running whatever version of Ultralytics you please. You need to use the exact one required by this repo. Luckily this can be fixed in an easy way. First

pip uninstall ultralytics

then just run track.py again and the correct Ultralytics version will be installed

@mikel-brostrom mikel-brostrom changed the title I am getting following error AttributeError: 'DeepOCSort' object has no attribute 'reset' Jan 18, 2024
@adinathkale01
Copy link
Author

thank you for the reply,
I just had a follow up query regarding multicamera
I'm using below command to run for the 2 camera feed
python3 track.py --source 2 4 --reid-model osnet_x0_25_msmt17.pt --show

but I'm getting below error
track.py: error: unrecognized arguments: 4

could you please suggest me a way to include both camera feed and assign the same id for the object when it passing through theses camera frames

thank you in advance!!

@mikel-brostrom
Copy link
Owner

Feel free to start another thread for a different topic

@yonadance
Copy link

when i run track.py
2024-01-25 22:13:09.017 | ERROR | boxmot.utils.checks:check_packages:26 - The 'ultralytics@ git+https://github.com/mikel-brostrom/ultralytics.git' distribution was not found and is required by the application
2024-01-25 22:13:09.018 | WARNING | boxmot.utils.checks:check_packages:29 -
Missing packages: "ultralytics @ git+https://github.com/mikel-brostrom/ultralytics.git"
Atempting installation...
2024-01-25 22:13:33.166 | ERROR | boxmot.utils.checks:check_packages:33 - Command 'pip install --no-cache "ultralytics @ git+https://github.com/mikel-brostrom/ultralytics.git" ' returned non-zero exit status 1.
what can i do besides pip install ultralytics.

@mikel-brostrom
Copy link
Owner

mikel-brostrom commented Jan 25, 2024

This: #1263 (comment)

is all you need @yonadance. Don't interrupt the installation

@TiTi45-tt
Copy link

I am runing in a server with no camera. While running track.py,it has a error :
global /io/opencv/modules/videoio/src/cap_v4l.cpp (902) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
Traceback (most recent call last):
File "tracking/track.py", line 175, in
run(opt)
File "/home/amax/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "tracking/track.py", line 98, in run
for frame_idx, r in enumerate(results):
File "/home/amax/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 44, in generator_context
response = gen.send(None)
File "/home/amax/anaconda3/envs/yolo/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 254, in stream_inference
self.setup_source(source if source is not None else self.args.source)
File "/home/amax/anaconda3/envs/yolo/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 228, in setup_source
self.dataset = load_inference_source(
File "/home/amax/anaconda3/envs/yolo/lib/python3.8/site-packages/ultralytics/data/build.py", line 175, in load_inference_source
dataset = LoadStreams(source, imgsz=imgsz, vid_stride=vid_stride, buffer=buffer)
File "/home/amax/anaconda3/envs/yolo/lib/python3.8/site-packages/ultralytics/data/loaders.py", line 95, in init
raise ConnectionError(f"{st}Failed to open {s}")
ConnectionError: 1/1: 0... Failed to open 0
How to fix it?

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

No branches or pull requests

4 participants