odegeasslbc / FastGAN-pytorch

Official implementation of the paper "Towards Faster and Stabilized GAN Training for High-fidelity Few-shot Image Synthesis" in ICLR 2021
GNU General Public License v3.0
600 stars 100 forks source link

Does it support multi gpu? #8

Closed lz1998 closed 3 years ago

lz1998 commented 3 years ago

when i set multi gpu True, an error occured

Traceback (most recent call last):
  File "train.py", line 200, in <module>
    train(args)
  File "train.py", line 144, in train
    err_dr, rec_img_all, rec_img_small, rec_img_part = train_d(netD, real_image, label="real")
  File "train.py", line 38, in train_d
    pred, [rec_all, rec_small, rec_part], part = net(data, label)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/parallel/data_parallel.py", line 162, in forward
    return self.gather(outputs, self.output_device)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/parallel/data_parallel.py", line 174, in gather
    return gather(outputs, output_device, dim=self.dim)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/parallel/scatter_gather.py", line 68, in gather
    res = gather_map(outputs)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
  File "/usr/local/lib/python3.7/dist-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
odegeasslbc commented 3 years ago

Sorry, it is not supported yet. Actually, only some simple code mods need to be made to adapt to multi-GPU. Contributions are welcomed.