AttributeError: 'STrack' object has no attribute '_count
Traceback (most recent call last):
File "tools/demo_track.py", line 372, in
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!
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.
THX!
@我也遇到了这个问题,当前该问题还在主干上存在,需要提交PR来解决一下 @feiyang-hku @iFighting
you need to replace yolox with the previous version
you need to replace yolox with the previous version how can i do that? thx!
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 2c082be
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
2c082be
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.
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
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 itertools.count() as the STrack counter inside the ByteTracker class. This argument is passed to the BaseTrack class so that whenever the next_id() method is called, the latest track id (count) can be fetched from this generator.
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
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
itertools.count()as the STrack counter inside the ByteTracker class. This argument is passed to the BaseTrack class so that whenever the next_id() method is called, the latest track id (count) can be fetched from this generator.
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 GitHubhttps://github.com/ifzhang/ByteTrack/issues/210#issuecomment-1166324063, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALV55KGVV2XY4FECOUBJHODVQ42DJANCNFSM5Z2KSRZA. You are receiving this because you authored the thread.Message ID: @.***>