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

Encounting TypeError when execute the training script #6

Closed
pavaris-pm opened this issue Dec 8, 2023 · 2 comments
Closed

Encounting TypeError when execute the training script #6

pavaris-pm opened this issue Dec 8, 2023 · 2 comments

Comments

@pavaris-pm
Copy link
Contributor

Can you give me an example of colab notebook to train the model? since i've tried execute a script in Google Colab, however, what i've got is that

The command to run a script (in Google Colab)

!python3 /content/SpatialAttentionGAN/train.py --experiment-name celeba_128_eyeglasses --target-attr Eyeglasses --gpu

Error encounted

Namespace(data_path='./data/celeba', attr_path='./data/list_attr_celeba.txt', target_attr='Goatee', image_size=128, batch_size=16, lr=0.0002, beta1=0.5, beta2=0.999, l1=20, l2=100, lgp=10, d_iters=3, total_kimg=1000, tick_kimg=5.0, sample_ticks=1, save_ticks=10, num_samples=64, experiment_name='celeba_128_eyeglasses2', gpu=False)
Traceback (most recent call last):
  File "/content/SpatialAttentionGAN/train.py", line 119, in <module>
    vutils.save_image(fixed_reals, join(sample_path, '{:07d}_real.jpg'.format(0)), nrow=8, padding=0, normalize=True, range=(-1., 1.))
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torchvision/utils.py", line 146, in save_image
    grid = make_grid(tensor, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
TypeError: make_grid() got an unexpected keyword argument 'range'
@pavaris-pm
Copy link
Contributor Author

I already know how to fix that, if you don't mind, i will make a PR to make this version of SpatialAttentionGAN compatible.

@elvisyjlin
Copy link
Owner

Thank @pavaris-pm for the contribution! The PR has been merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants