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

returned non-zero exit status 1. #22

Open
NimaDL opened this issue Mar 19, 2020 · 7 comments
Open

returned non-zero exit status 1. #22

NimaDL opened this issue Mar 19, 2020 · 7 comments

Comments

@NimaDL
Copy link

NimaDL commented Mar 19, 2020

@mrlooi thank you for your great job.

Running the code for multi-gpu has got this error:
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-u', 'tools/train_net.py', '--local_rank=1', '--config-file', 'configs/rotated/my_config.yaml']' returned non-zero exit status 1.

  • torch 1.4.0
  • torchvision 0.5.0
  • cuda 10.1
@mrlooi
Copy link
Owner

mrlooi commented Mar 19, 2020

Hey, I haven't tried torch 1.4. Posting the error trace would be helpful.
The config needs to update the number of GPUs, and make sure that batch size is a multiple of the GPUs

@NimaDL
Copy link
Author

NimaDL commented Mar 19, 2020

Hi
@mrlooi Thanks for your reply
This is the error appeared while I run it:

Traceback (most recent call last):
File "tools/train_net.py", line 196, in
main()
File "tools/train_net.py", line 189, in main
model = train(cfg, args.local_rank, args.distributed)
File "tools/train_net.py", line 89, in train
arguments,
File "/home/nima/rotated_bbox/rotated_maskrcnn/maskrcnn_benchmark/engine/trainer.py", line 71, in do_train
loss_dict = model(images, targets)
File "/home/nima/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/nima/.local/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 459, in forward
self.reducer.prepare_for_backward([])
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=True to torch.nn.parallel.DistributedDataParallel; (2) making sure all forward function 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 forward function. Please include the loss function and the structure of the return value of forward of your module when reporting this issue (e.g. list, dict, iterable). (prepare_for_backward at /pytorch/torch/csrc/distributed/c10d/reducer.cpp:518)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x33 (0x7fb6b1f9d273 in /home/nima/.local/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: c10d::Reducer::prepare_for_backward(std::vector<torch::autograd::Variable, std::allocatortorch::autograd::Variable > const&) + 0x734 (0x7fb6fcc829e4 in /home/nima/.local/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #2: + 0x691a4c (0x7fb6fcc71a4c in /home/nima/.local/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #3: + 0x1d3ef4 (0x7fb6fc7b3ef4 in /home/nima/.local/lib/python3.6/site-packages/torch/lib/libtorch_python.so)

@mrlooi
Copy link
Owner

mrlooi commented Mar 19, 2020

Have a look at defaults.py, IMS_PER_BATCH (should be a multipler of NGPUs)

As for the error you posted, haven't seen that before. Might have to do with different versions of torch, back then I used torch 1.1

@NimaDL
Copy link
Author

NimaDL commented Mar 19, 2020

@mrlooi Thanks
And what torchvision version?

@mrlooi
Copy link
Owner

mrlooi commented Mar 19, 2020

I believe 0.4 - 1.1

@NimaDL
Copy link
Author

NimaDL commented Mar 19, 2020

@mrlooi
The error when running on my own dataset
RuntimeError: invalid argument 2: non-empty 3D or 4D input tensor expected but got: [0 x 1 x 28 x 28] at /pytorch/aten/src/THCUNN/generic/SpatialDilatedMaxPooling.cu:37.

IMS_PER_BATCH = 16
NGPU = 2
By changing IMS_PER_BATCH to 2, 4, 8 same issue appears

@mrlooi
Copy link
Owner

mrlooi commented Mar 20, 2020

This is a separate issue.
See #21 (comment)

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

No branches or pull requests

2 participants