A colab notebook for training Stylegan2-ada on colab, transfer learning onto your own dataset.

Overview

Open In Colab

Stylegan2-Ada-Google-Colab-Starter-Notebook

A no thrills colab notebook for training Stylegan2-ada on colab.

transfer learning onto your own dataset has never been easier :)

If you appreciate my work send all crypto donations in Eth, Bnb, Matic, Avax etc on any chain to : 0xe0a09b49721FBD8B23c67a3a9fdE44be4412B8fD

Comments
  • maybe the pretrained weight is different from cfg

    maybe the pretrained weight is different from cfg

    ValueError: Cannot feed value of shape (3, 3, 512, 256) for Tensor 'G_synthesis_3/64x64/Conv0_up/weight/new_value:0', which has shape '(3, 3, 512, 512)'

    when I was using ffhq-res256-mirror-paper256-noaug.pkl pretrained weight , it can not be loaded then I print the layers_information:

    pretrained weight : rGs =

    rG =

    G_main Params OutputShape WeightShape


    latents_in - (?, 512) -
    labels_in - (?, 0) -
    G_mapping/Normalize - (?, 512) -
    G_mapping/Dense0 262656 (?, 512) (512, 512)
    G_mapping/Dense1 262656 (?, 512) (512, 512)
    G_mapping/Dense2 262656 (?, 512) (512, 512)
    G_mapping/Dense3 262656 (?, 512) (512, 512)
    G_mapping/Dense4 262656 (?, 512) (512, 512)
    G_mapping/Dense5 262656 (?, 512) (512, 512)
    G_mapping/Dense6 262656 (?, 512) (512, 512)
    G_mapping/Dense7 262656 (?, 512) (512, 512)
    G_mapping/Broadcast - (?, 14, 512) -
    dlatent_avg - (512,) -
    Truncation/Lerp - (?, 14, 512) -
    G_synthesis/4x4/Const 8192 (?, 512, 4, 4) (1, 512, 4, 4)
    G_synthesis/4x4/Conv 2622465 (?, 512, 4, 4) (3, 3, 512, 512) G_synthesis/4x4/ToRGB 264195 (?, 3, 4, 4) (1, 1, 512, 3)
    G_synthesis/8x8/Conv0_up 2622465 (?, 512, 8, 8) (3, 3, 512, 512) G_synthesis/8x8/Conv1 2622465 (?, 512, 8, 8) (3, 3, 512, 512) G_synthesis/8x8/Upsample - (?, 3, 8, 8) -
    G_synthesis/8x8/ToRGB 264195 (?, 3, 8, 8) (1, 1, 512, 3)
    G_synthesis/16x16/Conv0_up 2622465 (?, 512, 16, 16) (3, 3, 512, 512) G_synthesis/16x16/Conv1 2622465 (?, 512, 16, 16) (3, 3, 512, 512) G_synthesis/16x16/Upsample - (?, 3, 16, 16) -
    G_synthesis/16x16/ToRGB 264195 (?, 3, 16, 16) (1, 1, 512, 3)
    G_synthesis/32x32/Conv0_up 2622465 (?, 512, 32, 32) (3, 3, 512, 512) G_synthesis/32x32/Conv1 2622465 (?, 512, 32, 32) (3, 3, 512, 512) G_synthesis/32x32/Upsample - (?, 3, 32, 32) -
    G_synthesis/32x32/ToRGB 264195 (?, 3, 32, 32) (1, 1, 512, 3)
    G_synthesis/64x64/Conv0_up 1442561 (?, 256, 64, 64) (3, 3, 512, 256) G_synthesis/64x64/Conv1 721409 (?, 256, 64, 64) (3, 3, 256, 256) G_synthesis/64x64/Upsample - (?, 3, 64, 64) -
    G_synthesis/64x64/ToRGB 132099 (?, 3, 64, 64) (1, 1, 256, 3)
    G_synthesis/128x128/Conv0_up 426369 (?, 128, 128, 128) (3, 3, 256, 128) G_synthesis/128x128/Conv1 213249 (?, 128, 128, 128) (3, 3, 128, 128) G_synthesis/128x128/Upsample - (?, 3, 128, 128) -
    G_synthesis/128x128/ToRGB 66051 (?, 3, 128, 128) (1, 1, 128, 3)
    G_synthesis/256x256/Conv0_up 139457 (?, 64, 256, 256) (3, 3, 128, 64) G_synthesis/256x256/Conv1 69761 (?, 64, 256, 256) (3, 3, 64, 64)
    G_synthesis/256x256/Upsample - (?, 3, 256, 256) -
    G_synthesis/256x256/ToRGB 33027 (?, 3, 256, 256) (1, 1, 64, 3)


    Total 24767458

    build G network :

    G =

    G Params OutputShape WeightShape


    latents_in - (?, 512) -
    labels_in - (?, 0) -
    G_mapping/Normalize - (?, 512) -
    G_mapping/Dense0 262656 (?, 512) (512, 512)
    G_mapping/Dense1 262656 (?, 512) (512, 512)
    G_mapping/Dense2 262656 (?, 512) (512, 512)
    G_mapping/Dense3 262656 (?, 512) (512, 512)
    G_mapping/Dense4 262656 (?, 512) (512, 512)
    G_mapping/Dense5 262656 (?, 512) (512, 512)
    G_mapping/Dense6 262656 (?, 512) (512, 512)
    G_mapping/Dense7 262656 (?, 512) (512, 512)
    G_mapping/Broadcast - (?, 14, 512) -
    dlatent_avg - (512,) -
    Truncation/Lerp - (?, 14, 512) -
    G_synthesis/4x4/Const 8192 (?, 512, 4, 4) (1, 512, 4, 4)
    G_synthesis/4x4/Conv 2622465 (?, 512, 4, 4) (3, 3, 512, 512) G_synthesis/4x4/ToRGB 264195 (?, 3, 4, 4) (1, 1, 512, 3)
    G_synthesis/8x8/Conv0_up 2622465 (?, 512, 8, 8) (3, 3, 512, 512) G_synthesis/8x8/Conv1 2622465 (?, 512, 8, 8) (3, 3, 512, 512) G_synthesis/8x8/Upsample - (?, 3, 8, 8) -
    G_synthesis/8x8/ToRGB 264195 (?, 3, 8, 8) (1, 1, 512, 3)
    G_synthesis/16x16/Conv0_up 2622465 (?, 512, 16, 16) (3, 3, 512, 512) G_synthesis/16x16/Conv1 2622465 (?, 512, 16, 16) (3, 3, 512, 512) G_synthesis/16x16/Upsample - (?, 3, 16, 16) -
    G_synthesis/16x16/ToRGB 264195 (?, 3, 16, 16) (1, 1, 512, 3)
    G_synthesis/32x32/Conv0_up 2622465 (?, 512, 32, 32) (3, 3, 512, 512) G_synthesis/32x32/Conv1 2622465 (?, 512, 32, 32) (3, 3, 512, 512) G_synthesis/32x32/Upsample - (?, 3, 32, 32) -
    G_synthesis/32x32/ToRGB 264195 (?, 3, 32, 32) (1, 1, 512, 3)
    G_synthesis/64x64/Conv0_up 2622465 (?, 512, 64, 64) (3, 3, 512, 512) G_synthesis/64x64/Conv1 2622465 (?, 512, 64, 64) (3, 3, 512, 512) G_synthesis/64x64/Upsample - (?, 3, 64, 64) -
    G_synthesis/64x64/ToRGB 264195 (?, 3, 64, 64) (1, 1, 512, 3)
    G_synthesis/128x128/Conv0_up 1442561 (?, 256, 128, 128) (3, 3, 512, 256) G_synthesis/128x128/Conv1 721409 (?, 256, 128, 128) (3, 3, 256, 256) G_synthesis/128x128/Upsample - (?, 3, 128, 128) -
    G_synthesis/128x128/ToRGB 132099 (?, 3, 128, 128) (1, 1, 256, 3)
    G_synthesis/256x256/Conv0_up 426369 (?, 128, 256, 256) (3, 3, 256, 128) G_synthesis/256x256/Conv1 213249 (?, 128, 256, 256) (3, 3, 128, 128) G_synthesis/256x256/Upsample - (?, 3, 256, 256) -
    G_synthesis/256x256/ToRGB 66051 (?, 3, 256, 256) (1, 1, 128, 3)


    Total 30034338

    The two networks are not the same!!

    opened by Johnson-yue 1
  • PyTorch Verison

    PyTorch Verison

    Hello,

    This is not really an Issue but I wasn't sure where to put this question.

    I was wondering if you would do a version for StyleGan2_ada with PyTorch

    opened by SBenkara 0
  • Freeze the Generator

    Freeze the Generator

    Hello,

    is there a way to freeze the generator?

    I added this, but it does not seem to work. I basically did the same you did to freeze the discriminator.

    if freezedG is not None:
        assert isinstance(freezedG, int)
        if not freezedG >= 0:
            raise UserError('--freezed must be non-negative')
        desc += f'-freezed{freezedG:g}'
        args.G_args.freeze_layers = freezed
    

    I am also wondering why the generator was left without parameters to freeze it.

    opened by SBenkara 0
  • No module named 'training'

    No module named 'training'

    Hi, thanks for the notebook!

    I have difficulties getting it to run, as it is missing the module "training" and I also don't seem to be able to install it with pip.

    Do you have an idea how this could be fixed? Screenshot 2021-07-07 at 16 08 03

    Thank you!

    opened by vin-ni 0
  • dataset path not being recognized

    dataset path not being recognized

    Hey there. thank you so much for this notebook, it is exactly what I've been looking for!

    I can't seem to get it to recognize that my dataset is in the google drive and I'm not sure why. In cell [14] I keep getting the message 'Upload your images dataset as [path]', which is the exact path of my dataset. I have no idea what I could be doing wrong here; I've quadruple checked that both paths are the same. Has anyone else run into this issue?

    Thanks!

    opened by eluzzi5 0
  • How to save both qlatent and dlatent vectors along with the generated image?

    How to save both qlatent and dlatent vectors along with the generated image?

    Hi, I'm trying to save both qlatent and dlatent vectors along with the generated images for to find latent directions later. Can when i save the Zs vectors it only has shape 1,512 so i'm assuming its qlatent. So how does one also gets the dlatent vector also?

    opened by waleedrazakhan92 0
  • getting this to work with a Local GPU

    getting this to work with a Local GPU

    Hi I have managed to get my local gpu connected, but when I use my local gpu I can't run most of the cells that work fine when i use Googles gpu, the cells all turn red and don't run on my local gpu. Any tips on how to get that to work?

    opened by mindblowingaiart 0
Owner
Harnick Khera
Code created with the power of coffee
Harnick Khera
StyleGAN2-ada for practice

This version of the newest PyTorch-based StyleGAN2-ada is intended mostly for fellow artists, who rarely look at scientific metrics, but rather need a working creative tool. Tested on Python 3.7 + PyTorch 1.7.1, requires FFMPEG for sequence-to-video conversions. For more explicit details refer to the original implementations.

vadim epstein 170 Nov 16, 2022
StyleGAN2-ADA - Official PyTorch implementation

Need Help? If you’re new to StyleGAN2-ADA and looking to get started, please check out this video series from a course Lia Coleman and I taught in Oct

Derrick Schultz 217 Jan 4, 2023
StyleGAN2 with adaptive discriminator augmentation (ADA) - Official TensorFlow implementation

StyleGAN2 with adaptive discriminator augmentation (ADA) — Official TensorFlow implementation Training Generative Adversarial Networks with Limited Da

NVIDIA Research Projects 1.7k Dec 29, 2022
Cartoon-StyleGan2 🙃 : Fine-tuning StyleGAN2 for Cartoon Face Generation

Fine-tuning StyleGAN2 for Cartoon Face Generation

Jihye Back 520 Jan 4, 2023
Neural-Pull: Learning Signed Distance Functions from Point Clouds by Learning to Pull Space onto Surfaces(ICML 2021)

Neural-Pull: Learning Signed Distance Functions from Point Clouds by Learning to Pull Space onto Surfaces(ICML 2021) This repository contains the code

null 149 Dec 15, 2022
Using this codebase as a tool for my own research. Making some modifications to the original repo for my own purposes.

For SwapNet Create a list.txt file containing all the images to process. This can be done with the GNU find command: find path/to/input/folder -name '

Andrew Jong 2 Nov 10, 2021
Train an imgs.ai model on your own dataset

imgs.ai is a fast, dataset-agnostic, deep visual search engine for digital art history based on neural network embeddings.

Fabian Offert 5 Dec 21, 2021
Finetune the base 64 px GLIDE-text2im model from OpenAI on your own image-text dataset

Finetune the base 64 px GLIDE-text2im model from OpenAI on your own image-text dataset

Clay Mullis 82 Oct 13, 2022
Uni-Fold: Training your own deep protein-folding models

Uni-Fold: Training your own deep protein-folding models. This package provides an implementation of a trainable, Transformer-based deep protein foldin

DP Technology 187 Jan 4, 2023
Transfer-Learn is an open-source and well-documented library for Transfer Learning.

Transfer-Learn is an open-source and well-documented library for Transfer Learning. It is based on pure PyTorch with high performance and friendly API. Our code is pythonic, and the design is consistent with torchvision. You can easily develop new algorithms, or readily apply existing algorithms.

THUML @ Tsinghua University 2.2k Jan 3, 2023
Navigating StyleGAN2 w latent space using CLIP

Navigating StyleGAN2 w latent space using CLIP an attempt to build sth with the official SG2-ADA Pytorch impl kinda inspired by Generating Images from

Mike K. 55 Dec 6, 2022
StyleGAN2 - Official TensorFlow Implementation

StyleGAN2 - Official TensorFlow Implementation

NVIDIA Research Projects 10.1k Dec 28, 2022
StyleGAN2 Webtoon / Anime Style Toonify

StyleGAN2 Webtoon / Anime Style Toonify Korea Webtoon or Japanese Anime Character Stylegan2 base high Quality 1024x1024 / 512x512 Generate and Transfe

null 121 Dec 21, 2022
Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Matthias Wright 169 Dec 26, 2022
Non-Official Pytorch implementation of "Face Identity Disentanglement via Latent Space Mapping" https://arxiv.org/abs/2005.07728 Using StyleGAN2 instead of StyleGAN

Face Identity Disentanglement via Latent Space Mapping - Implement in pytorch with StyleGAN 2 Description Pytorch implementation of the paper Face Ide

Daniel Roich 58 Dec 24, 2022
Fine-tuning StyleGAN2 for Cartoon Face Generation

Cartoon-StyleGAN ?? : Fine-tuning StyleGAN2 for Cartoon Face Generation Abstract Recent studies have shown remarkable success in the unsupervised imag

Jihye Back 520 Jan 4, 2023
A collection of pre-trained StyleGAN2 models trained on different datasets at different resolution.

Awesome Pretrained StyleGAN2 A collection of pre-trained StyleGAN2 models trained on different datasets at different resolution. Note the readme is a

Justin 1.1k Dec 24, 2022
A web porting for NVlabs' StyleGAN2, to facilitate exploring all kinds characteristic of StyleGAN networks

This project is a web porting for NVlabs' StyleGAN2, to facilitate exploring all kinds characteristic of StyleGAN networks. Thanks for NVlabs' excelle

K.L. 150 Dec 15, 2022
Monitor your ML jobs on mobile devices📱, especially for Google Colab / Kaggle

TF Watcher TF Watcher is a simple to use Python package and web app which allows you to monitor ?? your Machine Learning training or testing process o

Rishit Dagli 54 Nov 1, 2022