File "/workspaces/yolov5/train.py", line 47, in <module> import val as validate # for…
- User
File "/workspaces/yolov5/train.py", line 47, in import val as validate # for end-of-epoch mAP ^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/yolov5/val.py", line 39, in from models.common import DetectMultiBackend File "/workspaces/yolov5/models/common.py", line 16, in import cv2 File "/home/codespace/.local/lib/python3.12/site-packages/cv2/init.py", line 181, in bootstrap() File "/home/codespace/.local/lib/python3.12/site-packages/cv2/init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/python/3.12.1/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- Assistant
The error message you're encountering indicates that the Python OpenCV package (
cv2) cannot find thelibGL.so.1shared library, which is commonly required for OpenCV to properly use OpenGL. This typically indicates that the necessary graphics libraries are not installed on your system.Solution:
You need to install the missing library. Depending on your operating system, you can follow these instructions:
For Ubuntu/Debian:
Open a terminal and run the following command:
sudo apt-get update sudo apt-get install libgl1-mesa-glxFor CentOS/RHEL:
If you're using CentOS or RHEL, use:
sudo yum install mesa-libGLFor Fedora:
Use:
sudo dnf install mesa-libGLFor Arch Linux:
Use:
sudo pacman -S mesa - User
github: up to date with https://github.com/ultralytics/yolov5 ✅ Traceback (most recent call last): File "/workspaces/yolov5/train.py", line 986, in main(opt) File "/workspaces/yolov5/train.py", line 656, in main check_file(opt.data), ^^^^^^^^^^^^^^^^^^^^ File "/workspaces/yolov5/utils/general.py", line 507, in check_file assert len(files), f"File not found: {file}" # assert file was found ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: File not found: ../workspaces/yolov5/datasets/rrv/rrv.yaml
- Assistant