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

Tutorial 1 fails to start training #154

Open
Novoneos opened this issue Mar 6, 2024 · 0 comments
Open

Tutorial 1 fails to start training #154

Novoneos opened this issue Mar 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Novoneos
Copy link

Novoneos commented Mar 6, 2024

When I am trying to run the first tutorial, the code crashes with

TypeError: make_grid() got an unexpected keyword argument 'range'

when attempting to start the training with trainer(dataloader). I can reproduce this problem with both training runs in Tutorial 1, both locally and in Colab.

To Reproduce
Steps to reproduce the behavior:

  1. I get the error locally and via Colab.
  2. Logging Configurations
    Saving Model at './model/gan0.model'
    Epoch 1 Summary
    Epoch time duration : 36.603763580322266
    generator Mean Gradients : 4.215454027754042
    discriminator Mean Gradients : 17.446136124523523
    Mean Running Discriminator Loss : 0.036255130790042944
    Mean Running Generator Loss : 0.5807476703609739
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    [<ipython-input-26-30fad058137b>](https://localhost:8080/#) in <cell line: 1>()
    ----> 1 trainer(dataloader)
    
    4 frames
    [/usr/local/lib/python3.10/dist-packages/torchgan/trainer/base_trainer.py] 
    (https://localhost:8080/#) in __call__(self, data_loader, **kwargs)
    474     def __call__(self, data_loader, **kwargs):
    475         self.batch_size = data_loader.batch_size
    --> 476         self.train(data_loader, **kwargs)
    
    [/usr/local/lib/python3.10/dist-packages/torchgan/trainer/base_trainer.py] 
    (https://localhost:8080/#) in train(self, data_loader, **kwargs)
    453 
    454             self.eval_ops(**kwargs)
    --> 455             self.logger.run_end_epoch(self, epoch, time.time() - start_time)
    456             self.optim_ops()
    457 
    
    [/usr/local/lib/python3.10/dist-packages/torchgan/logging/logger.py](https://localhost:8080/#) 
    in run_end_epoch(self, trainer, epoch, time_duration, *args)
    143         for logger in self.logger_end_epoch:
    144             if type(logger).__name__ == "ImageVisualize":
     --> 145                 logger(trainer)
    146             elif type(logger).__name__ == "MetricVisualize":
    147                 logger()
    
    [/usr/local/lib/python3.10/dist-packages/torchgan/logging/visualize.py] 
    (https://localhost:8080/#) in __call__(self, trainer, **kwargs)
    495                 with torch.no_grad():
    496                     image = generator(*self.test_noise[pos])
    --> 497                     image = torchvision.utils.make_grid(
    498                         image, nrow=self.nrow, normalize=True, range=(-1, 1)
    499                     )
    
    [/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py](https://localhost:8080/#) in 
    decorate_context(*args, **kwargs)
    113     def decorate_context(*args, **kwargs):
    114         with ctx_factory():
     --> 115             return func(*args, **kwargs)
    116 
    117     return decorate_context
    
    TypeError: make_grid() got an unexpected keyword argument 'range'
@Novoneos Novoneos added the bug Something isn't working label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant