1

i am trying using yolov5 but recently i got warning message like this:

WARNING 'ultralytics.yolo.v8' is deprecated since '8.0.136' and will be removed in '8.1.0'. Please use 'ultralytics.models.yolo' instead.

WARNING 'ultralytics.yolo.utils' is deprecated since '8.0.136' and will be removed in '8.1.0'. Please use 'ultralytics.utils' instead.

Note this warning may be related to loading older models. You can update your model to current structure with:

    import torch
    ckpt = torch.load("model.pt")  # applies to both official and custom models
    torch.save(ckpt, "updated-model.pt")

the problem is i dont using any of ultralytics.yolo.v8 and ulralytics.yolo.utils in my code

import torch
import cv2 as cv

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print(device)

# Reload model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')

the rest is just basic opencv to open camera, is anyone know what a problem is or the problem is from yolov5 repository?

JIST
  • 1,139
  • 2
  • 8
  • 30
Mr. x
  • 15
  • 5

1 Answers1

0

i dont using any of ultralytics.yolo.v8 and ulralytics.yolo.utils in my code

As it says, "Note this warning may be related to loading older models", which is what you're doing. The model file you're loading using torch.hub.load contains references to the old module name.

You can ignore the warning for now, but using that model will break if you update the ultralytics module to 8.1+.

AKX
  • 152,115
  • 15
  • 115
  • 172
  • i tried to change to `torch.load('yolov5s')` but it get an error instead. – Mr. x Jul 20 '23 at 07:55
  • I don't know why you'd try to do that. – AKX Jul 20 '23 at 08:16
  • uhm to resolve the warning message, so what can i do to fix the issue then? – Mr. x Jul 20 '23 at 08:22
  • It's a warning, not an error. It does tell you what you _could_ do, but again, you do not need to do anything; things will still work for now. Maybe someday someone will update the torch hub file to the new module syntax. – AKX Jul 20 '23 at 08:23