Could not run 'torchvision::nms'

I am using Windows 11, and I encounter an error with the YOLOv8 model in the following line:
results = model.track(frame, persist=True, conf=0.6)

The error is:
Could not run ‘torchvision::nms’ with arguments from the ‘CUDA’ backend

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Feb__8_05:53:42_Coordinated_Universal_Time_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0

torch 2.1.2+cu121
torchaudio 2.1.2+cu121
torchvision 0.16.2

Please provide detailed guidance on how to resolve this issue.

You might need to install torchvision with CUDA support as it seems the CPU-only version was installed.

pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url

The problem was solved by using the above command. Thank you very much.