question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help generating images

See original GitHub issue

My project finished training (completed at 100%), I can see all the generated images in the correct folders (yeah I ran them inside the bin folder).

But when I try to generate, it fails:

C:\Users\luiss\DevStuff\stylegan\bin>py stylegan2_pytorch --generate
continuing from previous epoch - 9
Traceback (most recent call last):
  File "stylegan2_pytorch", line 56, in <module>
    fire.Fire(train_from_folder)
  File "C:\Users\luiss\AppData\Local\Programs\Python\Python37\lib\site-packages\fire\core.py", line 138, in Fire        component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "C:\Users\luiss\AppData\Local\Programs\Python\Python37\lib\site-packages\fire\core.py", line 471, in _Fire       target=component.__name__)
  File "C:\Users\luiss\AppData\Local\Programs\Python\Python37\lib\site-packages\fire\core.py", line 675, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "stylegan2_pytorch", line 44, in train_from_folder
    model.evaluate(samples_name)
  File "C:\Users\luiss\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\autograd\grad_mode.py", line 49, in decorate_no_grad
    return func(*args, **kwargs)
  File "C:\Users\luiss\AppData\Local\Programs\Python\Python37\lib\site-packages\stylegan2_pytorch\stylegan2_pytorch.py", line 589, in evaluate
    torchvision.utils.save_image(generated_images, str(self.results_dir / self.name / f'{str(num)}.jpg'), nrow=num_rows)
  File "C:\Users\luiss\AppData\Local\Programs\Python\Python37\lib\site-packages\torchvision\utils.py", line 109, in save_image
    im.save(fp, format=format)
  File "C:\Users\luiss\AppData\Local\Programs\Python\Python37\lib\site-packages\PIL\Image.py", line 2099, in save       fp = builtins.open(filename, "w+b")
OSError: [Errno 22] Invalid argument: 'results\\default\\generated-02-21-2020_09:01:40.jpg'

any ideas?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
luchostercommented, Feb 21, 2020

ahhh ok ok, that’s good to know too. So it did a really good job for what I gave it. I’m going to collect more pictures and try again.

Thanks again for this, and sorry for being a pain with my Windows machine (I hate it but it’s the only one with the right specs lol). You’re awesome!

1reaction
luchostercommented, Feb 21, 2020

generated-02-21-2020_09-57-44 generated-02-21-2020_09-57-44-ema generated-02-21-2020_09-57-44-mr

Here are the best I could get so far. I have 285 pictures, it took about 40 hrs to train and the bestish models were 3 and 4 maybe even 5 a little, but I’m guessing that’s as good as is going to get? Is there anything you recommend to make it better?

Read more comments on GitHub >

github_iconTop Results From Across the Web

22 Tools and Resources to Create Images for Social Media
Check out this huge list of tools, apps, icons, and backgrounds for creating amazing, professional images for social media and marketing!
Read more >
13 Best AI Image Generators You Can Try in 2022 - Fotor
The AI image generator is a tool that can be used to generate realistic images from text. This kind of tool is based...
Read more >
How to Generate Images with AI - Rootstrap
These types of AI-powered models can help with generating images for blogs, album covers, printing wall paintings for our room or desk, ...
Read more >
AI Image generators, a complete guide to this new technology
AI image generators can produce high-quality art and realistic images much faster than humans. They can help artists develop ideas for new works ......
Read more >
How to Use AI to Create Images of Anything You Can Imagine
Instead of trying to dominate the world, artistically-inclined AI tools can turn anything you describe to them into an image. Come with us...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found