Skip to content

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