tomguluson92 / StyleGAN_PyTorch

The implementation of StyleGAN on PyTorch 1.0.1
540 stars 95 forks source link

Possible to run on a 1080 with 8GB? (memory error) #7

Open powerspowers opened 5 years ago

powerspowers commented 5 years ago

I have a DELL XPS with an nVidia 1080 w 8GB. My hope was to run StyleGAN on this rather than needing to jump to the cloud. Possible?

I disable blur2d by commenting out the lines including it

Getting this error:

:\Users\Powerpop\Anaconda3\lib\site-packages\skimage\transform\_warps.py:110: UserWarning: Anti-aliasing will be enabled by default in skimage 0.15 to avoid aliasing artifacts when down-sampling images.
  warn("Anti-aliasing will be enabled by default in skimage 0.15 to "
Traceback (most recent call last):
  File "train_stylegan.py", line 164, in <module>
    main(opts)
  File "train_stylegan.py", line 98, in main
    real_logit = D(real_img)
  File "C:\Users\Powerpop\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\Powerpop\Desktop\StyleGAN\networks_stylegan.py", line 651, in forward
    x = F.leaky_relu(self.conv6(x), 0.2, inplace=True)
  File "C:\Users\Powerpop\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\Powerpop\Anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 338, in forward
    self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 4.00 GiB (GPU 0; 8.00 GiB total capacity; 4.19 GiB already allocated; 2.06 GiB free; 8.04 MiB cached)
XiaoqiangZhou commented 5 years ago

@powerspowers I think you can reduce the batch size or remove some modules to lower the generated image resolution from 1024x1024 to 512 or 256.