cfotache / pytorch_objectdetecttrack

Object detection in images, and tracking across video frames

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Torch not compiled with CUDA enabled!

KiaDavari opened this issue · comments

HI.
i am trying run tracker code in my pc(windows 10)but i got this error.this is my project.please help me

Hey @Kia4631! I had just came across the same problem and this is how I solved it.
I think the reason for this error is because this code uses Cuda and it cannot run on the CPU if you don't modify it.
So, I declared a variable device, which checks whether there is Cuda enabled or not, if or not and if not then the code runs on the local computer CPU.

device = torch.device("Cuda" if torch.cuda.is_available() else "CPU")
then changed the model.cuda() -> model.to(device) and Tensor = torch.cuda.FloatTensor ->> Tensor = torch.FloatTensor