taey16 / pix2pixBEGAN.pytorch

A pytorch implementation of pix2pix + BEGAN (Boundary Equilibrium Generative Adversarial Networks)
183 stars 36 forks source link

how to train the model by multi gpus? #1

Open qinghua2016 opened 7 years ago

qinghua2016 commented 7 years ago

I can run the code with one single gpu. Do you know how to use multi gpus to run the code?

taey16 commented 7 years ago

I'm sorry for late reply. I'm not tried to this repo. with multi-gpus, however, I know the pytorch provides multi-gpu support like that

def forward(self, x): if isinstance(x.data, torch.cuda.FloatTensor) and self.ngpu > 1: x = nn.parallel.data_parallel(self.model, x, range(self.ngpu)) else: x = self.model(x)