ultralytics / ultralytics

Ultralytics YOLO11 πŸš€
https://docs.ultralytics.com
GNU Affero General Public License v3.0
36.57k stars 7.05k forks source link

cannot find coco.yaml #18967

Closed Hello0312 closed 2 weeks ago

Hello0312 commented 2 weeks ago

Search before asking

Ultralytics YOLO Component

Other

Bug

I use Windows 11 Home

Image

It says "FileNotFoundError: '/usr/src/ultralytics/ultralytics/cfg/datasets/coco.yaml' does not exist" I am confused as I don't have a USR folder because I do not use a UNIX-based system.

I think the actual 'coco.yaml' file is at path "C:\Users\total\AppData\Local\Programs\Python\Python312\Lib\site-packages\ultralytics\cfg\datasets".

Environment

System Info

Ultralytics 8.3.70 πŸš€ Python-3.12.8 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 4060 Laptop GPU, 8188MiB) Setup complete βœ… (24 CPUs, 31.7 GB RAM, 113.9/953.0 GB disk)

OS Windows-11-10.0.26100-SP0 Environment Windows Python 3.12.8 Install pip RAM 31.71 GB Disk 113.9/953.0 GB CPU Intel Core(TM) i7-14650HX CPU count 24 GPU NVIDIA GeForce RTX 4060 Laptop GPU, 8188MiB GPU count 1 CUDA 12.4

numpy βœ… 1.26.3<=2.1.1,>=1.23.0 matplotlib βœ… 3.10.0>=3.3.0 opencv-python βœ… 4.11.0.86>=4.6.0 pillow βœ… 10.2.0>=7.1.2 pyyaml βœ… 6.0.2>=5.3.1 requests βœ… 2.32.3>=2.23.0 scipy βœ… 1.15.1>=1.4.1 torch βœ… 2.5.1+cu124>=1.8.0 torch βœ… 2.5.1+cu124!=2.4.0,>=1.8.0; sys_platform == "win32" torchvision βœ… 0.20.1+cu124>=0.9.0 tqdm βœ… 4.67.1>=4.64.0 psutil βœ… 6.1.1 py-cpuinfo βœ… 9.0.0 pandas βœ… 2.2.3>=1.1.4 seaborn βœ… 0.13.2>=0.11.0 ultralytics-thop βœ… 2.0.14>=2.0.0 {'OS': 'Windows-11-10.0.26100-SP0', 'Environment': 'Windows', 'Python': '3.12.8', 'Install': 'pip', 'RAM': '31.71 GB', 'Disk': '113.9/953.0 GB', 'CPU': 'Intel Core(TM) i7-14650HX', 'CPU count': 24, 'GPU': 'NVIDIA GeForce RTX 4060 Laptop GPU, 8188MiB', 'GPU count': 1, 'CUDA': '12.4', 'Package Info': {'numpy': 'βœ… 1.26.3<=2.1.1,>=1.23.0', 'matplotlib': 'βœ… 3.10.0>=3.3.0', 'opencv-python': 'βœ… 4.11.0.86>=4.6.0', 'pillow': 'βœ… 10.2.0>=7.1.2', 'pyyaml': 'βœ… 6.0.2>=5.3.1', 'requests': 'βœ… 2.32.3>=2.23.0', 'scipy': 'βœ… 1.15.1>=1.4.1', 'torch': 'βœ… 2.5.1+cu124!=2.4.0,>=1.8.0; sys_platform == "win32"', 'torchvision': 'βœ… 0.20.1+cu124>=0.9.0', 'tqdm': 'βœ… 4.67.1>=4.64.0', 'psutil': 'βœ… 6.1.1', 'py-cpuinfo': 'βœ… 9.0.0', 'pandas': 'βœ… 2.2.3>=1.1.4', 'seaborn': 'βœ… 0.13.2>=0.11.0', 'ultralytics-thop': 'βœ… 2.0.14>=2.0.0'}}

Minimal Reproducible Example

Code

from ultralytics import YOLO

model = YOLO("yolo11n.pt")

metrics = model.val()

results = model("C:\Users\total\AppData\Local\Programs\Python\Python312\Lib\site-packages\ultralytics\assets\bus.jpg") results[0].show()

Additional

No response

Are you willing to submit a PR?

UltralyticsAssistant commented 2 weeks ago

πŸ‘‹ Hello @Hello0312, thank you for your interest in Ultralytics πŸš€! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

From the details provided, it appears you may be encountering a πŸ› bug. To help us investigate further, could you please ensure that your issue includes a minimum reproducible example? This helps us narrow down the root cause effectively.

Debugging Tips

It seems that a FileNotFoundError is being raised due to a missing coco.yaml file. To resolve this:

  1. Verify that your installation is up-to-date and all files are properly installed by upgrading to the latest release:
    pip install -U ultralytics
  2. Confirm the location of your coco.yaml file or redefine the path when required. The configuration files are typically located in a subdirectory under the library's package, so variation in paths across different setups can occur. Providing your file navigation paths in detail would be helpful.

Join the Community

Connect with the Ultralytics community for additional support:

Environments

YOLO can operate in various up-to-date environments. If you wish to re-run your setup or debug further, consider using any of the following verified options:

Status

Ultralytics CI

If the badge above is green, all Ultralytics CI tests are currently passing. The CI tests verify correct functionality across all YOLO Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Please note that this is an automated response. One of our Ultralytics engineers will take a closer look and assist you further as soon as possible πŸš€!

Y-T-G commented 2 weeks ago

Why do you want to run model.val() on MS COCO?

The reason it's probably using that path is because it was trained on Linux, so it saved that as the path. You can override it by passing data="coco.yaml" to model.val().