skip to Main Content

I was trying to run YOLOv8 using visual code studio. Installed ultralytics and ran yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg' on the vs code terminal.
However the output i received was

2 persons, 1 bicycle, 5 cars, 10 motorcycles, 73 boats, 3 stop signs, 1 dog, 10 horses, 10 cows, 32 bears, 1 giraffe, 63 umbrellas, 6 handbags, 9 frisbees, 15 snowboards, 5 surfboards, 12 knifes, 5 beds, 37 dining tables

which are clearly not part of this picture.

When i first installed ultralytics and tried running torch there was a missing dependency error. fbgemm.ddl was missing. Later when i installed vs_BuildTools this issue was resolved. Then i proceeded to run the code in a virtual environment where a program using torch ran without any errors. Then i proceeded to type this code snippet and encountered this problem. I also tried running using command prompt and jupyter notebook but the same issue persists.

I also did check if the versions are compatible, which they are. I haven’t installed cuda yet is it because of that or are there any other issues which i am not aware of? Somebody please help.

2

Answers


  1. I was facing same problem with yolov8n.pt model. I tried with downgrading ultralytics version from 8.2.70 to 8.2.60. The issue is resolved now.

    Login or Signup to reply.
  2. This is a known bug with inference using CPU on Windows for PyTorch 2.4.0 : Bug Ticket

    Common issues are:

    • Too many detections at the top of the image
    • Reporting missing fbgemm.dll

    Here are the recommended fixes:

    • When only CPU available: Downgrade PyTorch (CPU) to a previous version
    pip uninstall torch torchvision torchaudio -y
    pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cpu
    
    • When NVIDIA GPU with CUDA support available: Install PyTorch with CUDA support (will still fail in case of PyTorch 2.4.0 when using CPU)
    pip uninstall torch torchvision torchaudio -y
    pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
    
    • Install nightly build of PyTorch (WARNING: might be unstable)
    pip install torch  --index-url https://download.pytorch.org/whl/nightly/cu121 --force-reinstall
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search