Fix dtype mismatch in strided evaluation visibility assignment#180
Fix dtype mismatch in strided evaluation visibility assignment#180YannickGibson wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
|
Hi @YannickGibson! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Fix dtype mismatch in strided evaluation
Problem
When running strided evaluation on TapVid-DAVIS dataset, the evaluator crashes with:
Command:
Output:
This occurs at line 271 in
cotracker/evaluation/core/evaluator.pywhen attempting to merge predictions from forward and backward passes.Environment
Solution
Convert
pred_vsbto matchinv_pred_vsbdtype before indexed assignment:This ensures dtype compatibility between the destination tensor and source tensor during the assignment operation. The fix dynamically matches the dtype from the model output rather than hardcoding, making it robust across different precision modes (fp32, fp16, bfloat16).
Testing
Verified fix resolves the issue when running:
Resulting JSON
{ "occlusion_accuracy": 0.6789913433103425, "pts_within_1": 0.3681140514159171, "jaccard_1": 0.2810965209136301, "pts_within_2": 0.5160547528215811, "jaccard_2": 0.4269992312134806, "pts_within_4": 0.6188633490338561, "jaccard_4": 0.5340930209458256, "pts_within_8": 0.6852129258977692, "jaccard_8": 0.5834998947998223, "pts_within_16": 0.7527433967957153, "jaccard_16": 0.597554944076797, "average_jaccard": 0.48464872238991114, "average_pts_within_thresh": 0.5881976951929677, "time": 168.436683177948 }