Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what's going on yolo v5? #13122

Open
1 task done
PKAV69 opened this issue Jun 23, 2024 · 4 comments
Open
1 task done

what's going on yolo v5? #13122

PKAV69 opened this issue Jun 23, 2024 · 4 comments
Labels
question Further information is requested

Comments

@PKAV69
Copy link

PKAV69 commented Jun 23, 2024

Search before asking

Question

I have spent seven or eight hours and encountered various problems, such as incompatible python packages or incompatible python versions that prevented the package from being installed in a lower version. I tried versions 3.7-3.11, but there are still many problems.I have allocated 20 GB of virtual memory.Because there are too many errors, only the attachment form can be used
bug.txt

Additional

python 3.8.0
tensorboard 2.14.0
tensorboard-data-server 0.7.2
tensorflow 2.6.0
tensorflow-estimator 2.15.0
tensorflow-gpu 2.6.0
torch 1.8.0+cu111
torchvision 0.9.0+cu111
numpy 1.23.4
Pillow 9.5.0

@PKAV69 PKAV69 added the question Further information is requested label Jun 23, 2024
Copy link
Contributor

👋 Hello @PKAV69, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics

@glenn-jocher
Copy link
Member

@PKAV69 hello,

Thank you for reaching out and for providing detailed information about the issues you're encountering. Let's work through this together to get you up and running with YOLOv5.

Steps to Resolve:

  1. Python and PyTorch Versions:

    • YOLOv5 requires Python >=3.8.0 and PyTorch >=1.8.0. From your provided details, it looks like you are using Python 3.8.0 and PyTorch 1.8.0, which are compatible. However, I recommend upgrading to the latest versions to ensure compatibility and access to the latest features and bug fixes.
    • You can upgrade Python and PyTorch as follows:
      pip install --upgrade python
      pip install torch torchvision --upgrade
  2. Cloning the YOLOv5 Repository:

    • Ensure you have the latest YOLOv5 code by cloning the repository and installing the requirements:
      git clone https://github.com/ultralytics/yolov5
      cd yolov5
      pip install -r requirements.txt
  3. Minimum Reproducible Example:

    • To better assist you, we need a minimum reproducible code example. This helps us understand the specific issues you're facing and allows us to reproduce the bug on our end. Please follow the guidelines here: Minimum Reproducible Example.
  4. Virtual Memory:

    • Allocating 20 GB of virtual memory is a good step. Ensure your system has enough physical RAM and that your GPU drivers are up to date.
  5. Common Issues and Solutions:

    • Verify that you are not facing any common issues listed in our FAQ.

Example Command for Training:

Here is an example command to start training with YOLOv5 on a single GPU:

python train.py --batch 64 --data coco.yaml --weights yolov5s.pt --device 0

For multi-GPU training using DistributedDataParallel (recommended):

python -m torch.distributed.run --nproc_per_node 2 train.py --batch 64 --data coco.yaml --weights yolov5s.pt --device 0,1

Additional Resources:

For more detailed instructions on multi-GPU training, please refer to our Multi-GPU Training Guide.

If you continue to experience issues, please provide the specific error messages or logs from your bug.txt file, and we can dive deeper into resolving them.

Thank you for your patience and for being part of the YOLO community! 🚀

@PKAV69
Copy link
Author

PKAV69 commented Jun 25, 2024

@PKAV69 hello,  你好,

Thank you for reaching out and for providing detailed information about the issues you're encountering. Let's work through this together to get you up and running with YOLOv5.谢谢你为达成和提供的详细信息有关的问题你遇到。 让我们通过这个工作在一起让你和运行与YOLOv5.

Steps to Resolve: 步骤来解决:

  1. Python and PyTorch Versions:蟒蛇和PyTorch的版本:

    • YOLOv5 requires Python >=3.8.0 and PyTorch >=1.8.0. From your provided details, it looks like you are using Python 3.8.0 and PyTorch 1.8.0, which are compatible. However, I recommend upgrading to the latest versions to ensure compatibility and access to the latest features and bug fixes.YOLOv5需要Python>=3.8.0和PyTorch>=1.8.0. 从提供的详细信息,这看起来就像你正在使用Python3.8.0和PyTorch1.8.0,这是兼容的。 然而,我推荐你升级到最新版本,以确保兼容性和访问的最新特征和缺陷的修复。
    • You can upgrade Python and PyTorch as follows:
      你可以升级Python和PyTorch如下:```shell
      pip install --upgrade python
      pip install torch torchvision --upgrade
  2. Cloning the YOLOv5 Repository:克隆的YOLOv5库:

    • Ensure you have the latest YOLOv5 code by cloning the repository and installing the requirements:
      确保你有最新的YOLOv5码的克隆的储存库和安装要求:```shell
      git clone https://github.com/ultralytics/yolov5
      cd yolov5
      pip install -r requirements.txt
  3. Minimum Reproducible Example:最小可重复的例子:

    • To better assist you, we need a minimum reproducible code example. This helps us understand the specific issues you're facing and allows us to reproduce the bug on our end. Please follow the guidelines here: Minimum Reproducible Example.更好地协助你,我们需要一个最低可重复代码的例子。 这有助于我们了解具体问题你面对使我们能够重现错误在我们结束。 请遵循的准则:最低可重复的例子。
  4. Virtual Memory: 虚拟存储器:

    • Allocating 20 GB of virtual memory is a good step. Ensure your system has enough physical RAM and that your GPU drivers are up to date.分配的20个虚拟存储器是一个良好的步骤。 确保系统具有足够的物理存和你GPU驱动程序是最新的。
  5. Common Issues and Solutions:共同的问题和解决方案:

    • Verify that you are not facing any common issues listed in our FAQ.验证你是不是面临任何共同的问题列在我们的常见问题。

Example Command for Training:

例如命令的培训:
Here is an example command to start training with YOLOv5 on a single GPU:这里的一个例子是命令开始培训与YOLOv5在一个单一的GPU:

python train.py --batch 64 --data coco.yaml --weights yolov5s.pt --device 0

For multi-GPU training using DistributedDataParallel (recommended):多GPU培训使用DistributedDataParallel(建议):

python -m torch.distributed.run --nproc_per_node 2 train.py --batch 64 --data coco.yaml --weights yolov5s.pt --device 0,1

Additional Resources: 额外资源:

For more detailed instructions on multi-GPU training, please refer to our Multi-GPU Training Guide.有关更详细的说明在数据管理培训,请参阅我们数据管理培训指南。

If you continue to experience issues, please provide the specific error messages or logs from your bug.txt file, and we can dive deeper into resolving them.如果你继续遇到问题,请提供具体的错误信息或记录,从你的 bug.txt 文件中,我们可以深入了解决这些问题。

Thank you for your patience and for being part of the YOLO community! 🚀感谢您的耐心和为正在部分YOLO的社区! 🚀

Thank you for your reply.
Maybe I should start over. I will try to install python 3.10+ again, but some packages of lower versions cannot be installed in higher versions, such as numpy and tensorflow-gpu. I don't understand whether tensorflow-2.6.0 will affect training and reasoning. According to the official website of tensorflow, if you want to use tensorflow_gpu-2.6.0 or tensorflow-2.6.0, you need python version less than 3.9 and cuda version less than 11.2 and cuDNN version less than 8.1. If there is no impact, I will choose cuda 11.8.

@glenn-jocher
Copy link
Member

Hello @PKAV69,

Thank you for your detailed follow-up. Let's address your concerns and ensure you have a smooth setup for YOLOv5.

Python and Package Compatibility

  1. Python Version:

    • YOLOv5 works well with Python >=3.8.0. While Python 3.10+ is supported, you might face compatibility issues with some packages. If you encounter such issues, Python 3.8 or 3.9 are good alternatives.
  2. TensorFlow and PyTorch:

    • YOLOv5 primarily relies on PyTorch, so TensorFlow versions should not impact YOLOv5 training and inference. You can safely focus on getting the correct versions of PyTorch and its dependencies.

Recommended Setup

  1. Python Environment:

    • Create a new virtual environment to avoid conflicts:
      python -m venv yolov5-env
      source yolov5-env/bin/activate  # On Windows use `yolov5-env\Scripts\activate`
  2. Install YOLOv5 and Dependencies:

    • Clone the YOLOv5 repository and install the required packages:
      git clone https://github.com/ultralytics/yolov5
      cd yolov5
      pip install -r requirements.txt
  3. Install Compatible PyTorch and CUDA:

    • Ensure you have a compatible version of PyTorch with CUDA. For example, for CUDA 11.8:
      pip install torch==1.12.0+cu118 torchvision==0.13.0+cu118 -f https://download.pytorch.org/whl/torch_stable.html

Addressing TensorFlow Concerns

  • Since YOLOv5 does not depend on TensorFlow, you can choose to install TensorFlow in a separate environment if needed. This way, you can avoid any conflicts with PyTorch.

Example Training Command

Once your environment is set up, you can start training with the following command:

python train.py --batch 64 --data coco.yaml --weights yolov5s.pt --device 0

For multi-GPU training using DistributedDataParallel:

python -m torch.distributed.run --nproc_per_node 2 train.py --batch 64 --data coco.yaml --weights yolov5s.pt --device 0,1

Additional Resources

For more detailed instructions on multi-GPU training, please refer to our Multi-GPU Training Guide.

Next Steps

If you encounter any specific errors, please provide a minimum reproducible code example and the exact error messages. This will help us diagnose and resolve the issues more effectively. You can follow the guidelines here: Minimum Reproducible Example.

Thank you for your patience and for being part of the YOLO community! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants