2

When i load a model with YOLOv5 and specify 'cpu', yolo is still using 'gpu'. Why?

The code:

model = yolov5.load(model, device='cuda' if torch.cuda.is_available() else 'cpu')
print('cuda' if torch.cuda.is_available() else 'cpu')

prints cpu

It is always writing the following message into the console which is quite annoying:

UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
  warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')
talonmies
  • 70,661
  • 34
  • 192
  • 269
Joysn
  • 987
  • 1
  • 16
  • 30

1 Answers1

0

This is a PyTorch specific bug unrelated to YOLOv5. See https://github.com/pytorch/pytorch/issues/72527

Glenn Jocher
  • 76
  • 1
  • 3