Unable to use "Show Progress"
See original GitHub issueSummary: Running lightweight_gan --models_dir "path" --show-progress
results in a AttributeError: 'NoneType' object has no attribute 'split'
Full error:
Generating progress images: 0% 0/30 [00:04<?, ?it/s] Traceback (most recent call last): File "/usr/local/bin/lightweight_gan", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/lightweight_gan/cli.py", line 185, in main fire.Fire(train_from_folder) File "/usr/local/lib/python3.6/dist-packages/fire/core.py", line 138, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/usr/local/lib/python3.6/dist-packages/fire/core.py", line 468, in _Fire target=component.__name__) File "/usr/local/lib/python3.6/dist-packages/fire/core.py", line 672, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/usr/local/lib/python3.6/dist-packages/lightweight_gan/cli.py", line 166, in train_from_folder model.show_progress(num_images=num_image_tiles, types=generate_types) File "/usr/local/lib/python3.6/dist-packages/torch/autograd/grad_mode.py", line 26, in decorate_context return func(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/lightweight_gan/lightweight_gan.py", line 1217, in show_progress generated_image = self.generate_truncated(self.GAN.G, latents) File "/usr/local/lib/python3.6/dist-packages/torch/autograd/grad_mode.py", line 26, in decorate_context return func(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/lightweight_gan/lightweight_gan.py", line 1272, in generate_truncated generated_images = evaluate_in_chunks(self.batch_size, G, style) File "/usr/local/lib/python3.6/dist-packages/lightweight_gan/lightweight_gan.py", line 99, in evaluate_in_chunks split_args = list(zip(*list(map(lambda x: x.split(max_batch_size, dim=0), args)))) File "/usr/local/lib/python3.6/dist-packages/lightweight_gan/lightweight_gan.py", line 99, in <lambda> split_args = list(zip(*list(map(lambda x: x.split(max_batch_size, dim=0), args)))) AttributeError: 'NoneType' object has no attribute 'split'
I’ve tried populating all the fields listed in the readme just to check with no luck.
For additional context here’s the command used to train the model and generate the checkpoints:
lightweight_gan --num-train-steps 150000 --data /content/images --optimizer "adabelief" --attn-res-layers [32,64,128] --image-size 512 --disc-output-size 5 --models_dir "/LightGAN/" --results_dir "/LightGAN/results" --calculate_fid_every 25000
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Issue arises at line 1208:
https://github.com/lucidrains/lightweight-gan/blob/359c868ec8eddd83b200e31b49f88501cbff674c/lightweight_gan/lightweight_gan.py#L1197-L1210
It looks like
checkpoints
(returned at line 1198) is None, as in #48.You might want to ensure that you are running the latest release of the package.
Try this:
lightweight_gan --name name-of-your-model --show-progress --num-image-tiles 4 --generate-types [ema]
Library dont support--models_dir "path"
argument.