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

in _ddp_init_helper expect_sparse_gradient) RuntimeError: Model replicas must have an equal number of parameters. #2311

Closed
AIYoungcino opened this issue Feb 27, 2021 · 4 comments
Labels

Comments

@AIYoungcino
Copy link

在hpc上训练YOLOv5,单节点单卡可以运行,但单节点多卡,多节点多卡都会报错。

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2021

👋 Hello @xioyung, 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://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

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), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@AIYoungcino
Copy link
Author

/public/software/apps/DeepLearning/PyTorch/rocm3.3_torch1.5/lib/python3.6/site-packages/torch/nn/parallel/distributed.py:303: UserWarning: Single-Process Multi-GPU is not the recommended mode for DDP. In this mode, each DDP instance operates on multiple devices and creates multiple module replicas within one process. The overhead of scatter/gather and GIL contention in every forward pass can slow down training. Please consider using one DDP instance per device or per module replica by explicitly setting device_ids or CUDA_VISIBLE_DEVICES. NB: There is a known issue in nn.parallel.replicate that prevents a single DDP instance to operate on multiple model replicas.
"Single-Process Multi-GPU is not the recommended mode for "
Namespace(adam=False, batch_size=16, bucket='', cache_images=False, cfg='./models/yolov5x.yaml', data='./data/mydata.yaml', device='1', epochs=300, img_size=[640], multi_scale=False, name='', noautoanchor=False, nosave=False, notest=False, rect=False, single_cls=False, weights='weights/last.pt')
Using CUDA device0 _CudaDeviceProperties(name='Device 66a1', total_memory=16368MB)
device1 _CudaDeviceProperties(name='Device 66a1', total_memory=16368MB)
device2 _CudaDeviceProperties(name='Device 66a1', total_memory=16368MB)
device3 _CudaDeviceProperties(name='Device 66a1', total_memory=16368MB)

@NanoCode012
Copy link
Contributor

NanoCode012 commented Mar 1, 2021

@xioyung, pull latest code base and check Multi-GPU Tutorial https://docs.ultralytics.com/yolov5

@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

2 participants