-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
Multi-GPU distributed error #9504
Comments
👋 Hello @MinjeongKim03, 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 support@ultralytics.com. RequirementsPython>=3.7.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 EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf 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. |
@MinjeongKim03 it appears you may have environment problems. Please ensure you meet all dependency requirements if you are attempting to run YOLOv5 locally. If in doubt, create a new virtual Python 3.9 environment, clone the latest repo (code changes daily), and 💡 ProTip! Try one of our verified environments below if you are having trouble with your local environment. RequirementsPython>=3.7.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 Models and datasets download automatically from the latest YOLOv5 release when first requested. EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf 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. |
I changed to Python 3.9 environment and tried again, but the following error occurred. Traceback (most recent call last): File "/home/()/()/yolov5/train.py", line 630, in Traceback (most recent call last): File "/home/()/()/yolov5/train.py", line 630, in main(opt) File "/home/()/()/yolov5/train.py", line 526, in main main(opt) File "/home/()/()/yolov5/train.py", line 526, in main train(opt.hyp, opt, device, callbacks) File "/home/()/()/yolov5/train.py", line 109, in train train(opt.hyp, opt, device, callbacks) File "/home/()/()/yolov5/train.py", line 110, in train with torch_distributed_zero_first(LOCAL_RANK): File "/home/()/.conda/envs/()/lib/python3.9/contextlib.py", line 119, in enter data_dict = data_dict or check_dataset(data) # check if None File "/home/()/.conda/envs/()/lib/python3.9/contextlib.py", line 126, in exit return next(self.gen) File "/home/()/()/yolov5/utils/torch_utils.py", line 91, in torch_distributed_zero_first next(self.gen) File "/home/()/()/yolov5/utils/torch_utils.py", line 94, in torch_distributed_zero_first dist.barrier(device_ids=[local_rank]) File "/home/qisens/.conda/envs/minjeong_2/lib/python3.9/site-packages/torch/distributed/distributed_c10d.py", line 2784, in barrier dist.barrier(device_ids=[0]) File "/home/()/.conda/envs/()/lib/python3.9/site-packages/torch/distributed/distributed_c10d.py", line 2784, in barrier work = default_pg.barrier(opts=opts)work = default_pg.barrier(opts=opts) RuntimeErrorRuntimeError: : NCCL error in: ../torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:46, unhandled cuda error, NCCL version 2.10.3 ncclUnhandledCudaError: Call to CUDA function failed.NCCL error in: ../torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:46, unhandled cuda error, NCCL version 2.10.3 ncclUnhandledCudaError: Call to CUDA function failed. ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 2416573) of binary: /home/()/.conda/envs/()/bin/python Traceback (most recent call last): File "/home/()/.conda/envs/()/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/()/.conda/envs/()/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/()/.conda/envs/()/lib/python3.9/site-packages/torch/distributed/run.py", line 765, in main() File "/home/()/.conda/envs/()/lib/python3.9/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 345, in wrapper return f(*args, **kwargs) File "/home/()/.conda/envs/()/lib/python3.9/site-packages/torch/distributed/run.py", line 761, in main run(args) File "/home/()/.conda/envs/()/lib/python3.9/site-packages/torch/distributed/run.py", line 752, in run elastic_launch( File "/home/()/.conda/envs/()/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 131, in call return launch_agent(self._config, self._entrypoint, list(args)) File "/home/()/.conda/envs/()/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 245, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ train.py FAILED ------------------------------------------------------------ Failures: [1]: time : 2022-09-21_13:56:16 host :() rank : 1 (local_rank: 1) exitcode : 1 (pid: 2416574) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2022-09-21_13:56:16 host : () rank : 0 (local_rank: 0) exitcode : 1 (pid: 2416573) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================ |
@MinjeongKim03 I would run DDP training in our Docker image if you are having local environment issues: EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
|
I tried to use Docker image but still got the same error. |
Good news 😃! Docker training issue related to ClearML should now be fixed ✅ in PR #9876. To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐! |
Search before asking
Question
Hello I run this command. But I got an error.
terminal command
python -m torch.distributed.run --nproc_per_node 2 train.py --batch 16 --img 640 --epochs 300 --data data/coco.yaml --weights yolov5s.pt --patience 300 --device 0,1 --save-period 1
error
Additional
No response
The text was updated successfully, but these errors were encountered: