ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
51.25k stars 16.44k forks source link

How to select other devices when run a job with single GPU? -YOLOv5 for HPC usage #6398

Closed Jeon-YoungGyu closed 2 years ago

Jeon-YoungGyu commented 2 years ago

Hi, it's a student who just started to learn deep learning.

I'm trying to run yolov5 with SLURM scheduler. When I submit a job, the scheduler will reserve CPUs or GPUs randomly as much as I requested.

And it is ok to yolov5 either, when multi GPUs job. But, when I'm trying to submit single GPU job, it seems yolov5 automatically allocate GPU No.0 only even though I put "python -m torch.distributed.launch --nproc_per_node 1 train.py --batch 12 --data coco.yaml --weights yolov5n.pt --device 1" To use my scheduler and yolov5 simultaneously, it must be a big obstacle because, multiple single GPU jobs will cause memory shortage in GPU No. 0.

So, if it is possible, I want to fix the default device select settings which selects device 0 automatically. How can I fix it?

Thank you very much for your help in advance. Regards, -Young-

github-actions[bot] commented 2 years ago

👋 Hello @Jeon-YoungGyu, 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 screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. 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

CI CPU testing

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