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

track_id bug with fp16 #22

Closed
yanghaibin-cool opened this issue May 13, 2022 · 7 comments
Closed

track_id bug with fp16 #22

yanghaibin-cool opened this issue May 13, 2022 · 7 comments

Comments

@yanghaibin-cool
Copy link

Hi,here.When targets is converted to FP16, the track_id will lose the precision, resulting in wrong labels for reid.
How to separate track_id annotations from variable targets. And set targets to torch.float16as current code, but keep track_id to be torch.float32.I tried to modify it, but it didn't work.
Looking forward to your update on this bug.Thank you.

@HanGuangXin
Copy link
Owner

HanGuangXin commented May 14, 2022

I have already made a PR to ByteTrack and it is merged to master branch. Have you check it already?

ifzhang/ByteTrack#184
ifzhang/ByteTrack#182

And yes, the PR I made doesn't include operations in yolo_head.py, where reid loss is computed.

@HanGuangXin
Copy link
Owner

The changes in yolo_head.py should be 4 lines, more or less. I just have no time to verify the results in current version.

@yanghaibin-cool
Copy link
Author

The changes in yolo_head.py should be 4 lines, more or less. I just have no time to verify the results in current version.

Thanks, I will try to modify the id_loss in yolo_head.py myself. Thanks again for open-sourcing this project, the combination of bytetrack_reid and other tracking strategies has been very helpful for my work.

@HanGuangXin
Copy link
Owner

Just like I mentioned in ifzhang/ByteTrack#184: "Hi, I'm thinking about separate track_id annotations from variable targets. And set targets to torch.float16as current code, but keep track_id to be torch.float32."

So the only thing you should do is eparate track_id annotations from variable targets, then pass it to yolo head. I think it is just a matter of some function interfaces.

If you finish it, a PR is welcome.

@HanGuangXin
Copy link
Owner

Or I can update it when I got time.

@yanghaibin-cool
Copy link
Author

Or I can update it when I got time.

image
Could I change it like this directly? It can be trained like this, but I don't know if it's right or not.

@HanGuangXin
Copy link
Owner

Hi, I don't think cat 2 tensors with different dtype is a correct operation.

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