-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
error on using parallel gpu #404
Comments
I can confirm that this problem goes away if you use number of examples in training set as a multiple of accumulate X batch_size.Eg - If batch size is 16 and accumulate is 4 then your training set length should be a multiple of 16*4=64. |
I have encountered this error too,so have you got a solution on this now? |
All, it goes without saying that your batch_size should always be divisible by the number of GPUs. So for example batch_size 10 with 4 GPUs is not ok. Multi-GPU should be ok as long as you follow this rule. Default COCO train set has 117,263 images and trains (and tests) fine on a GCP instance with 1, 2, 4 or 8 GPUs under the default settings. |
@glenn-jocher trained with batch_size of 14 and 2 gpu, still got this error |
@turboxin
sudo rm -rf yolov3 # remove exising repo
git clone https://github.com/ultralytics/yolov3 && cd yolov3 # git clone latest
python3 detect.py # verify detection
python3 train.py # verify training (a few batches only)
# CODE TO REPRODUCE YOUR ISSUE HERE
If none of these apply to you, we suggest you close this issue and raise a new one using the Bug Report template, providing screenshots and minimum viable code to reproduce your issue. Thank you! |
@sanazss I am encountering the same error, even the batch size is the multiple of GPUs. May I know how you solved this problem at the end? Thanks so much! |
Both batch_size and number of train.txt rows should always be divisible by the number of GPUs |
Hi. I am using your very last version and get this erro after one epoch. any hint on what is the error
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 its output (the return value of
forward
). You can enable unused parameter detection by passing the keyword argumentfind_unused_parameters=True
totorch.nn.parallel.DistributedDataParallel
. If you already have this argument set, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module'sforward
function. Please include the structure of the return value offorward
of your module when reporting this issue (e.g. list, dict, iterable). (prepare_for_backward at /pytorch/torch/csrc/distributed/c10d/reducer.cpp:408)frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x2b9d1c82b441 in /redresearch/ssalati/venv/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x2a (0x2b9d1c82ad7a in /redresearch/ssalati/venv/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #2: c10d::Reducer::prepare_for_backward(std::vector<torch::autograd::Variable, std::allocatortorch::autograd::Variable > const&) + 0x5ec (0x2b9cdd08483c in /redresearch/ssalati/venv/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #3: + 0x6c52bd (0x2b9cdd07a2bd in /redresearch/ssalati/venv/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #4: + 0x130cfc (0x2b9cdcae5cfc in /redresearch/ssalati/venv/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #31: __libc_start_main + 0xf1 (0x2b9cb531c2e1 in /lib/x86_64-linux-gnu/libc.so.6)
it tells me to put a flag of find_unused_parameters=True
in
torch.nn.parallel.DistributedDataParallel`.would you kindly let me know of the problem.thanks
The text was updated successfully, but these errors were encountered: