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

[Bug Fix]: Remove unsupported 'range' argument in make_grid #459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nnh12
Copy link

@nnh12 nnh12 commented Nov 20, 2024

In the latest version of torchvision.utils, the make_grid function in does not accept range as an argument. This PR fixes the issue found below:

Traceback (most recent call last):
 File "/home/nathan/new/DALLE-pytorch/train_vae.py", line 262, in <module>
   images, recons, hard_recons = map(lambda t: make_grid(t.float(), nrow = int(sqrt(k)), normalize = True, range = (-1, 1)), (images, recons, hard_recons))
 File "/home/nathan/new/DALLE-pytorch/train_vae.py", line 262, in <lambda>
   images, recons, hard_recons = map(lambda t: make_grid(t.float(), nrow = int(sqrt(k)), normalize = True, range = (-1, 1)), (images, recons, hard_recons))
 File "/home/nathan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
   return func(*args, **kwargs)
TypeError: make_grid() got an unexpected keyword argument 'range'
Traceback (most recent call last):
 File "/home/nathan/new/DALLE-pytorch/train_vae.py", line 262, in <module>
   images, recons, hard_recons = map(lambda t: make_grid(t.float(), nrow = int(sqrt(k)), normalize = True, range = (-1, 1)), (images, recons, hard_recons))
 File "/home/nathan/new/DALLE-pytorch/train_vae.py", line 262, in <lambda>
   images, recons, hard_recons = map(lambda t: make_grid(t.float(), nrow = int(sqrt(k)), normalize = True, range = (-1, 1)), (images, recons, hard_recons))
 File "/home/nathan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
   return func(*args, **kwargs)
TypeError: make_grid() got an unexpected keyword argument 'range'

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

Successfully merging this pull request may close these issues.

1 participant