Comments (7)
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.
from lightweight-gan.
Issue arises at line 1208:
lightweight-gan/lightweight_gan/lightweight_gan.py
Lines 1197 to 1210 in 359c868
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.
from lightweight-gan.
Unfortunately no dice. Different error this time though.
Ran: lightweight_gan --name "default" --show-progress --num-image-tiles 4 --generate-types [ema]
Log: Generating progress images: 0it [00:00, ?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 1208, in show_progress for checkpoint in tqdm(checkpoints, desc='Generating progress images'): File "/usr/local/lib/python3.6/dist-packages/tqdm/std.py", line 1104, in __iter__ for obj in iterable: TypeError: 'NoneType' object is not iterable Generating progress images: 0it [00:00, ?it/s]
from lightweight-gan.
Currently running the latest (0.17.4). Worth noting that this is running in Colab, not sure why it would cause this but I'd be remiss to not mention this.
from lightweight-gan.
Dang it, I was pretty sure I had it there. With models_dir being unsupported here, I figured it was unable to find the checkpoints since it checks ./models/model-name/ but in my environment, the checkpoints are in ./model-name/. Moved the folders around... Now I'm back to the first error.
Generating progress images: 0% 0/32 [00:00<?, ?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 1223, in show_progress generated_image = self.generate_truncated(self.GAN.GE, 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' Generating progress images: 0% 0/32 [00:12<?, ?it/s]
The number of checkpoints is accurate though, so it found the files at least... progress 👍🏾
(Edit: link to Colab for generating progress (I have a separate one that does the training) for additional context https://colab.research.google.com/drive/1H9Mh406f_Bc1ImIGnQObp3H0OXTRDJ08?usp=sharing)
Update: Confirmed issue is present in 0.17.5
from lightweight-gan.
Can you show files structure with model checkpoints and usage command?
from lightweight-gan.
Heres the file structure for the working directory:
LightGAN/
├── default/
│ ├── .config.json
│ ├── model_1.pt
│ ├── model_10.pt
│ ├── model_11.pt
│ ├── model_12.pt
│ ├── model_13.pt
│ . . .
│ ├── model_45.pt
│ ├── model_5.pt
│ ├── model_6.pt
│ ├── model_7.pt
│ ├── model_8.pt
│ └── model_9.pt
├── generated/
│ └── default/
├── models/
│ └── default/
│ ├── .config.json
│ ├── model_1.pt
│ ├── model_10.pt
│ ├── model_11.pt
│ ├── model_12.pt
│ ├── model_13.pt
│ . . .
│ ├── model_45.pt
│ ├── model_5.pt
│ ├── model_6.pt
│ ├── model_7.pt
│ ├── model_8.pt
│ └── model_9.pt
└── results/
├── default/
│ ├── 0-ema.jpg
│ ├── 0.jpg
│ ├── 1-ema.jpg
│ ├── 1.jpg
│ ├── 10-ema.jpg
│ ├── 10.jpg
│ ├── 11-ema.jpg
│ ├── 11.jpg
│ ├── 12-ema.jpg
│ ├── 12.jpg
│ ├── 13-ema.jpg
│ ├── 13.jpg
│ ├── 14-ema.jpg
│ ├── 14.jpg
│ ├── 15-ema.jpg
│ ├── 15.jpg
│ ├── 16-ema.jpg
│ ├── 16.jpg
│ ├── 17-ema.jpg
│ ├── 17.jpg
│ ├── 18-ema.jpg
│ ├── 18.jpg
│ ├── 19-ema.jpg
│ ├── 19.jpg
│ ├── 2-ema.jpg
│ ├── 2.jpg
│ . . .
│ ├── 59.jpg
│ ├── 6-ema.jpg
│ ├── 6.jpg
│ ├── 60-ema.jpg
│ ├── 60.jpg
│ ├── 61-ema.jpg
│ ├── 61.jpg
│ ├── 7-ema.jpg
│ ├── 7.jpg
│ ├── 8-ema.jpg
│ ├── 8.jpg
│ ├── 9-ema.jpg
│ ├── 9.jpg
│ └── fid_scores.txt
└── default-progress/
Command for generating 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 "/content/drive/MyDrive/Colab Notebooks/LightGAN" --results_dir "/content/drive/MyDrive/Colab Notebooks/LightGAN/results" --calculate_fid_every 25000
Command for generating progress:
lightweight_gan --name "default" --show-progress --num-image-tiles 4 --generate-types [ema]
from lightweight-gan.
Related Issues (20)
- Error(s) in loading state_dict for LightweightGAN HOT 2
- Batchnorm layer missing in the discriminator?
- showing results while training ? HOT 2
- G is showing up a negative number. What does that mean?
- Multi GPU utilization problem.
- TypeError: __init__() got an unexpected keyword argument 'hparams' HOT 1
- unable to load save model. please try downgrading the package to the version specified by the saved model HOT 7
- --load_strict=False failing to load model HOT 1
- Can't find "__main__" module (sorry if noob question) HOT 4
- loss implementation differs from paper HOT 1
- Doesn't detect CUDA from Nvidia GPU HOT 1
- Torchvision Assertion error while importing custom data
- Aim installation error HOT 4
- Discriminator Loss converges to 0 while Generator loss pretty high HOT 3
- Dont detects cuda HOT 1
- Using Lightweight GAN as a library
- Projecting generated Images to Latent Space HOT 1
- Executing with a trailing \ in the arguments sets the variable new to the truthy value '\\' and deletes all progress
- CUDA out of memory error while generating interpolations
- Minimum number data training
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightweight-gan.