Code Monkey home page Code Monkey logo

Comments (13)

erdavis1 avatar erdavis1 commented on June 6, 2024 3

Haha, if only I could!

I ended up being pretty happy with the results of this run, even though it was fairly slow (~7 sec/iter if I got a V100)

!unet_stylegan2 --data jpegs/ --attn-layers [1,2] --batch-size 32 --gradient-accumulate-every 8 --aug-prob 0.25 --aug-types [translation,cutout,color]

Closing the issue since I'm satisfied with the output.

17k:
image

from unet-stylegan2.

erdavis1 avatar erdavis1 commented on June 6, 2024 1

@lucidrains Thanks! I'm very new to this, if it isn't obvious.

I tried the following and also got pretty quick mode collapse.

!unet_stylegan2 --data jpegs/ --attn-layers [1,2] --aug-prob 0.25
9k iterations:
image

I feel like drastically increasing the batch size has given me the best results of what I've tried, but I'm really struggling to find a balance where my results are good+diverse, but it doesn't take >15secs per iteration to train.

Are there any other tricks to consider, aside from batch size?

from unet-stylegan2.

erdavis1 avatar erdavis1 commented on June 6, 2024 1

I have. with very similar results

from unet-stylegan2.

erdavis1 avatar erdavis1 commented on June 6, 2024 1

Thanks! I'll try running that today and report back.

from unet-stylegan2.

lucidrains avatar lucidrains commented on June 6, 2024

@erdavis1 you are working in the realm of small data, so i would suggest turning on augmentation! you can do so with --aug-prob 0.25

from unet-stylegan2.

lucidrains avatar lucidrains commented on June 6, 2024

@erdavis1 there actually isn't any contrastive regularization in unet-stylegan2, i removed it since it doesn't fit within the unet discriminator framework

from unet-stylegan2.

lucidrains avatar lucidrains commented on June 6, 2024

Have you tried plain stylegan2, without the unet? github.com/lucidrains/stylegan2-pytorch

from unet-stylegan2.

lucidrains avatar lucidrains commented on June 6, 2024

@erdavis1 try with augmentation, but with an effective batch size of 64. That means just a batch size of 32 and the gradient accumulate every of 2

from unet-stylegan2.

erdavis1 avatar erdavis1 commented on June 6, 2024

The following ended up in a very quick mode collapse, unfortunately:
unet_stylegan2 --data jpegs/ --attn-layers [1,2] --batch-size 32 --gradient-accumulate-every 2 --aug-prob 0.25

1k:
image

20k:
image

For my knowledge, what differences would you expect to see in a model trained with an effective batch size of 64 (batch size 32, gradient accumulate every 2) vs. one also with effective batch size 64 (batch size 8, gradient accumulate every 8)

from unet-stylegan2.

lucidrains avatar lucidrains commented on June 6, 2024

@erdavis1 i updated the augmentation code in v0.5.0 if you'd like to give that a try. --aug-prob 0.25 --aug-types [translation,cutout,color]

from unet-stylegan2.

erdavis1 avatar erdavis1 commented on June 6, 2024

Good news and bad news.

Using the following, I experienced less mode collapse!
unet_stylegan2 --data jpegs/ --attn-layers [1,2] --batch-size 32 --gradient-accumulate-every 2 --aug-prob 0.25 --aug-types [translation,cutout,color]

It partially collapsed around 18k:
image

and fully collapsed around 21k:
image

The images do seem to be a bit more smeary/blurry than the test with a higher gradient-accumulate-every, but I'm not sure if that's related to that, or to the augmentation.

This is a big improvement, and ran pretty quickly at 2secs/iteration. I'm wondering if I slowly edge up the effective batch size, I'll hit upon a level where there's less collapse and clearer results without sacrificing too much speed. I am in no rush, and if I get nice results I'll wait as long as I need to.

from unet-stylegan2.

lucidrains avatar lucidrains commented on June 6, 2024

@erdavis1 get more data! lol

from unet-stylegan2.

lucidrains avatar lucidrains commented on June 6, 2024

🚀🚀

from unet-stylegan2.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.