ifzhang / ByteTrack

[ECCV 2022] ByteTrack: Multi-Object Tracking by Associating Every Detection Box
MIT License
4.69k stars 891 forks source link

Problem with Torch/Torchvision on Jetson Nano #202

Open majrblais opened 2 years ago

majrblais commented 2 years ago

I'm trying to setiup the env to use ByteTrack on a Nano but I have a hard time setting up Torch/Torchvision.

First pip3 install torch does not work because it is not installed using cuda, I then had to download it using this tutorial: https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-11-now-available/72048.

I was able to install torch (verified with torch.cuda.is_available()) and torchvision (using pip3 for torchvision). However when I run demo_track I get this error: Couldn't load custom C++ ops. This can happen if your PyTorch and " RuntimeError: Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install. The source of the error is from line 54 "site-packages/torchvision/extension.py" , I checked and it seems that
def _has_ops(): return True

It never actually used the new definition (even if it should, the try was able to pass) so I changed line 5 to always have return True.

I also had to modify return torch.ops.torchvision.nms(boxes, scores, iou_threshold) to return torchvision.ops.nms(boxes, scores, iou_threshold) in home/user/torch/lib/python3.6/site-packages/torchvision/ops/boxes.py

and then I get the error: RecursionError: maximum recursion depth exceeded (yes I tried augmenting it to like 10k)

I've been trying to setup this thing on my nano for days now and can't seem to get it to work, I've tried many verisons of torch/torchvisions, different env (conda,pip,no env) but torchvision seems to cause issues