how to train use multigpu?
lyxbyr opened this issue · 2 comments
when i use this scripy but met this error, how to change code?
python -m torch.distributed.launch --nproc_per_node 6 --master_port 1234 train.py --data xxx.yaml --cfg yolov5s_city_seg.yaml --batch-size 60 --epochs 200 --weights ./yolov5s.pt --workers 32 --label-smoothing 0.1 --img-size 832 --noautoanchor --device 2,3,4,5,6,7
RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by (1) passing the keyword argument
find_unused_parameters=Trueto
torch.nn.parallel.DistributedDataParallel; (2) making sure all
forwardfunction outputs participate in calculating loss. If you already have done the above two steps, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module's
forwardfunction. Please include the loss function and the structure of the return value of
forward` of your module when reporting this issue
i has set find_unused_parameters=True but still met this error @topiaruss @olehb @jakepoz @pcgeek86
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.