M3D-RPN icon indicating copy to clipboard operation
M3D-RPN copied to clipboard

TypeError: zip argument #1 must support iteration

Open mrsempress opened this issue 3 years ago • 2 comments

Did anyone get the same problem? Or did anyone has ideas?

  File "scripts/train_rpn_3d.py", line 196, in <module>
    main(sys.argv[1:])
  File "scripts/train_rpn_3d.py", line 122, in main
    cls, prob, bbox_2d, bbox_3d, feat_size = rpn_net(images)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 156, in forward
    return self.gather(outputs, self.output_device)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 168, in gather
    return gather(outputs, output_device, dim=self.dim)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 68, in gather
    res = gather_map(outputs)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
TypeError: zip argument #1 must support iteration```

mrsempress avatar Apr 01 '21 02:04 mrsempress

Did anyone get the same problem? Or did anyone has ideas?

  File "scripts/train_rpn_3d.py", line 196, in <module>
    main(sys.argv[1:])
  File "scripts/train_rpn_3d.py", line 122, in main
    cls, prob, bbox_2d, bbox_3d, feat_size = rpn_net(images)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 156, in forward
    return self.gather(outputs, self.output_device)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 168, in gather
    return gather(outputs, output_device, dim=self.dim)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 68, in gather
    res = gather_map(outputs)
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
  File "/home/xxx/miniconda3/envs/Monocular3D/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
TypeError: zip argument #1 must support iteration```

i meet the same question,have you solved it?thanks

wangziniu1109 avatar Jun 24 '21 07:06 wangziniu1109

Hello, I found this is a problem caused by the multi-gpu defined in line 69 of lib/core.py # multi-gpu network = torch.nn.DataParallel(network)

I comment this line to switch off the parellel computing

And then fixed a few issues in RPN_3d_loss caused by problems in converting of cuda tensor to numpy format

Then the training code works

Childhoo avatar Sep 24 '21 09:09 Childhoo