Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAN example not working #291

Closed
vobecant opened this issue Oct 20, 2020 · 7 comments
Closed

GAN example not working #291

vobecant opened this issue Oct 20, 2020 · 7 comments
Labels
help wanted Extra attention is needed
Milestone

Comments

@vobecant
Copy link

🐛 Bug

The GAN example for MNIST doesn't work as advised in the script basic_gan_module.py https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/master/pl_bolts/models/gans/basic/basic_gan_module.py

To Reproduce

Steps to reproduce the behavior:

To reproduce the issue just run https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/master/pl_bolts/models/gans/basic/basic_gan_module.py
basic_gan_module.py --gpus 1

Expected behavior

Train the GAN network well for MNIST dataset with the default setting.

Environment

@vobecant vobecant added the help wanted Extra attention is needed label Oct 20, 2020
@github-actions
Copy link

Hi! thanks for your contribution!, great first issue!

@akihironitta
Copy link
Contributor

@vobecant Thank you for submitting the issue! Would it be possible to share the error message with us?

@vobecant
Copy link
Author

vobecant commented Oct 23, 2020

@akihironitta Here is the error message:
Traceback (most recent call last):
File "basic_gan_module.py", line 203, in
dm, model, trainer = cli_main()
File "basic_gan_module.py", line 172, in cli_main
from pl_bolts.datamodules import CIFAR10DataModule, ImagenetDataModule, MNISTDataModule, STL10DataModule
ImportError: cannot import name 'ImagenetDataModule' from 'pl_bolts.datamodules' (/home/vobecant/miniconda3/envs/pytorch16/lib/python3.8/site-packages/pl_bolts/datamodules/init.py)

@akihironitta
Copy link
Contributor

@vobecant Thank you for sharing the error message! I'll have a look at it.

@akihironitta
Copy link
Contributor

@vobecant Currently, we have a problem in pl_bolts/datamodules/__init__.py, and the error occurs as you described. An easiest workaround would be to modify cli_main() function defined in pl_bolts/models/gans/basic/basic_gan_module.py.

Specifically, would you mind changing
https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/f0939f62a5559a9a68cbb60ab8cbddac8c42cb05/pl_bolts/models/gans/basic/basic_gan_module.py#L171
to

    from pl_bolts.datamodules import CIFAR10DataModule
    from pl_bolts.datamodules.imagenet_datamodule import ImagenetDataModule
    from pl_bolts.datamodules.mnist_datamodule import MNISTDataModule
    from pl_bolts.datamodules.stl10_datamodule import STL10DataModule

?
It should work, but let me know if it still doesn't work.

@akihironitta
Copy link
Contributor

@vobecant It looks the problem in pl_bolts/datamodules/__init__.py has been solved in #303, so would you just update to the current master branch, and retry?

@ananyahjha93
Copy link
Contributor

like @akihironitta mentioned, this was due to the datamodules issue which has been fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants