lucidrains / lightweight-gan

Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two
MIT License
1.63k stars 222 forks source link

TypeError: meshgrid() got an unexpected keyword argument 'indexing' #112

Closed sebastiantrella closed 2 years ago

sebastiantrella commented 2 years ago

Since today I get this error:

continuing from previous epoch - 12 loading from version 0.20.6 autosetting augmentation probability to 30% Dices_imagesize256_batchsize16</notebooks/dices>: 8%|█████████▎ | 12000/150000 [00:00<?, ?it/s]Traceback (most recent call last): File "/opt/conda/bin/lightweight_gan", line 8, in sys.exit(main()) File "/opt/conda/lib/python3.8/site-packages/lightweight_gan/cli.py", line 190, in main fire.Fire(train_from_folder) File "/opt/conda/lib/python3.8/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/opt/conda/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/opt/conda/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, kwargs) File "/opt/conda/lib/python3.8/site-packages/lightweight_gan/cli.py", line 181, in train_from_folder run_training(0, 1, model_args, data, load_from, new, num_train_steps, name, seed) File "/opt/conda/lib/python3.8/site-packages/lightweight_gan/cli.py", line 67, in run_training retry_call(model.train, tries=3, exceptions=NanException) File "/opt/conda/lib/python3.8/site-packages/retry/api.py", line 101, in retry_call return retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, logger) File "/opt/conda/lib/python3.8/site-packages/retry/api.py", line 33, in retry_internal return f() File "/opt/conda/lib/python3.8/site-packages/lightweight_gan/lightweight_gan.py", line 1111, in train fake_output, fake_output32x32, = D_aug(generated_images, detach = True, *aug_kwargs) File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/opt/conda/lib/python3.8/site-packages/lightweight_gan/lightweight_gan.py", line 352, in forward images = DiffAugment(images, types=types) File "/opt/conda/lib/python3.8/site-packages/lightweight_gan/diff_augment.py", line 10, in DiffAugment x = f(x) File "/opt/conda/lib/python3.8/site-packages/lightweight_gan/diff_augment.py", line 83, in rand_cutout grid_batch, grid_x, grid_y = torch.meshgrid( TypeError: meshgrid() got an unexpected keyword argument 'indexing'

lucidrains commented 2 years ago

@sebastiantrella ahh ok, i'm just going to enforce the latest version of torch (1.10) https://github.com/lucidrains/lightweight-gan/releases/tag/0.20.8

sebastiantrella commented 2 years ago

Yes, updating torch did help...Thanks.