facebookresearch / pytorch_GAN_zoo

A mix of GAN implementations including progressive growing
BSD 3-Clause "New" or "Revised" License
1.62k stars 271 forks source link

torchhub #31

Closed Molugan closed 5 years ago

Molugan commented 5 years ago

Refactor the code in order to make the training script compatible with torchub : https://github.com/pytorch/vision/blob/master/hubconf.py

Molugan commented 5 years ago

TODO:

1) refactor: move the BASEGAN.optimizeParameters function into the GAN trainer 2) make the hubconf file

ailzhang commented 5 years ago

There's an typo here: https://github.com/fairinternal/pytorch_GAN_zoo/blob/master/hubconf.py#L75 (additional : in the end). It would be great if we could have pretrained weights available somewhere.

Besides that, it works great with torch.hub. Thanks!

In [1]: import torch.hub

In [2]: torch.hub.load('fairinternal/pytorch_GAN_zoo', 'DCGAN', useGPU=True, pretrained=False)
Out[2]: <models.DCGAN.DCGAN at 0x7fee97740f60>
Molugan commented 5 years ago

The weights will be added soon, I just need to do the procedure for s3.

Arrrg the typo ><. I'm on it !

ailzhang commented 5 years ago

FYI checkpoint for PGAN works great!

In [6]: torch.hub.load('fairinternal/pytorch_GAN_zoo', 'PGAN', useGPU=True, pretrained=True)
Using cache found in /private/home/ailzhang/.torch/hub/pytorch_GAN_zoo_masterDownloading: "https://dl.fbaipublicfiles.com/gan_zoo/celebaHQ_s5_i96000-5fe58222.pth" to /private/home/ailzhang/.torch/models/celebaHQ_s5_i96000-5fe58222.pth
275319082it [00:04, 62441877.81it/s]
Average network found !
Out[6]: <models.progressive_gan.ProgressiveGAN at 0x7f496f721eb8>
Molugan commented 5 years ago

39 for DCGAN