-
Notifications
You must be signed in to change notification settings - Fork 926
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: 'STrack' object has no attribute '_count #210
Comments
Something seems to be wrong with the code...I was able to run the code yesterday. But today this error message popped out. I have tried creating a new conda environment and installed the dependencies again but is facing the same problem. Please help! |
Hello, may I ask whether this problem has been solved? I have also encountered this problem. |
I was able to work around it by git cloning from an older commit (The one on May 13, 2022). Please see this post for your reference. The command to git clone from an older commit can be found at https://stackoverflow.com/questions/3555107/git-clone-particular-version-of-remote-repository. |
Thank you very much! |
ifzhang#210 Fix for Issue: AttributeError: 'STrack' object has no attribute '_count ifzhang#210. ifzhang#210 Add base class initialization.
THX! |
@我也遇到了这个问题,当前该问题还在主干上存在,需要提交PR来解决一下 @feiyang-hku @iFighting |
you need to replace yolox with the previous version |
|
修改STrack class初始化方法,在其初始化方法中,调用父类BaseTrack的初始化方法。修正[bug 210](ifzhang#210)
You have to add the super().init in the STrack so it can access the baseclass variables |
I think this issue cannot be simply resolved by adding the super().init() method in the STrack class. Doing so seems to lead to issue #219. Checking out at the previous commit seems to be a better option in the current stage. My script works fine at the previous commit |
hello I have met the same problem that only single box is output, could you please tell me some details about your solution? since I checkout the commit 2c082be, but it seems can't work, still return _'STrack' object has no attribute 'count' |
Hi @Breezewrf the _count variable is not useful..what I did was I created a self.id_count for the bytetracker class and then passed it as an argument to the function call where we creat the new tracks and assigned that self.id_counter to the track_ID and then incremented the variable |
Yes @jasons1425 you are right I faced the same issue but I added a new variable for counting the objects so that got resolved. |
Thanks a lot! problem got resolved |
Thank you @PranvQT. The problem is likely because each STrack object has its own track_id counting instead of the class-level one, so different tracks for the same ByteTracker object are sharing the same track_id. To count the number of tracks in each ByteTracker object without relying on the BaseTrack class attributes, I have added an |
I'm new to bytetrack. Can I see your code to see what changes should be made to get it to run over a video
|
I didn't make many changes honestly. Just added a counter to count the track ids for each ByteTracker. You can find the changes in this pull request. The modified scripts work fine in my local environment, but I would recommend you to just pull the main branch which has been recently reverted to get rid of this issue :) |
Hi Yifu,
Thank you so much for your prompt reply!
I tried to add the line “self._count = 0” to byte_tracker.py as you have suggested. The code can now run, but the algorithm can only detect and track only one person (ID 1) in a scene full of people.
***@***.***
May I know what other steps I need to take if I want to detect and track all people in the scene?
Thanks again for your kind help!
Sincerely,
Feiyang
From: sr99622 ***@***.***>
Date: Sunday, June 26, 2022 at 12:50 AM
To: ifzhang/ByteTrack ***@***.***>
Cc: feiyang-hku ***@***.***>, Author ***@***.***>
Subject: Re: [ifzhang/ByteTrack] AttributeError: 'STrack' object has no attribute '_count (Issue #210)
For some reason, the inheritance doesn't work on this class, You can get around it by adding a reference In byte_tracker.py to _count in the STrack.init like so
class STrack(BaseTrack):
shared_kalman = KalmanFilter()
def __init__(self, tlwh, score):
self._count = 0
—
Reply to this email directly, view it on GitHub<#210 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALV55KGVV2XY4FECOUBJHODVQ42DJANCNFSM5Z2KSRZA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Traceback (most recent call last):
File "tools/demo_track.py", line 372, in
main(exp, args)
File "tools/demo_track.py", line 365, in main
imageflow_demo(predictor, vis_folder, current_time, args)
File "tools/demo_track.py", line 263, in imageflow_demo
online_targets = tracker.update(outputs[0], [img_info['height'], img_info['width']], exp.test_size)
File "/content/ByteTrack/yolox/tracker/byte_tracker.py", line 268, in update
track.activate(self.kalman_filter, self.frame_id)
File "/content/ByteTrack/yolox/tracker/byte_tracker.py", line 48, in activate
self.track_id = self.next_id()
File "/content/ByteTrack/yolox/tracker/basetrack.py", line 36, in next_id
self._count += 1
AttributeError: 'STrack' object has no attribute '_count'
The text was updated successfully, but these errors were encountered: