File /MixSort/yolox/mixsort_oc_tracker/mixformer.py:103 causes TypeError: expected Tensor as element 0 in argument 0, but got tuple
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 99
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
torch.stack(template_imgs).float().div(255) on line 103 in /MixSort/yolox/mixsort_oc_tracker/mixformer.py
template_imgs = normalize(
torch.stack(template_imgs).float().div(255),
self.cfg.DATA.MEAN,
self.cfg.DATA.STD,
)
causes TypeError: expected Tensor as element 0 in argument 0, but got tuple.
I've followed the installation instructions https://github.com/MCG-NJU/MixSort#installation. My code fragment that triggers the problem is as following,
from collections import namedtuple
from yolox.mixsort_oc_tracker.mixsort_oc_tracker import MIXTracker
ArgsTuple = namedtuple("ArgsTuple", ["script", "config", "alpha", "radius", "mix_iou", "local_rank"])
argsTuple = ArgsTuple("mixformer_deit", "track", 0.6, 0, 0.2, 0)
tracker = MIXTracker(det_thresh = 0.5, args = argsTuple, use_byte=False)
vcapture = cv2.VideoCapture("path-to-video")
while(True):
success, frame = vcapture.read()
if not success:
break
detections = # fill in from a custom YOLOv8 model
detections = tracker.update(raw_detection, (1,1), (1,1), frame, scale = False)
The call stack:
File /MixSort/yolox/mixsort_oc_tracker/mixsort_oc_tracker.py:284, in MIXTracker.update(self, output_results, img_info, img_size, img, scale)
File /MixSort/yolox/mixsort_oc_tracker/association.py:272, in associate(detections, trackers, iou_threshold, velocities, previous_obs, vdc_weight, img, mixformer, alpha, templates)
File /MixSort/yolox/mixsort_oc_tracker/mixformer.py:103, in MixFormer.compute_vit_sim(self, detections, trackers, img, templates)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with yolox/mixsort_oc_tracker/mixformer.py:103 and inspect the value of template_imgs before torch.stack. Trace how it is passed through association.py:272 and mixsort_oc_tracker.py:284, then reproduce the supplied MIXTracker.update call. Done means the reported path no longer raises the tuple-versus-Tensor TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100