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

Issues
  • 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
  • Would you add generate function code

    Would you add generate function code

    Hi, would you add generate function code that implement:

    1. load weight from finetuned network
    2. generate some samples by finetuned network
    opened by Johnson-yue 1
  • 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
  • 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
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 118 Nov 26, 2021
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 143 Dec 2, 2021
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.5k Nov 30, 2021
Cartoon-StyleGan2 🙃 : Fine-tuning StyleGAN2 for Cartoon Face Generation

Fine-tuning StyleGAN2 for Cartoon Face Generation

Jihye Back 263 Nov 21, 2021
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 35 Dec 1, 2021
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 1 Nov 30, 2021
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 44 Nov 8, 2021
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 1.2k Dec 3, 2021
Try out deep learning models online on Google Colab

Try out deep learning models online on Google Colab

Erdene-Ochir Tuguldur 1.2k Nov 30, 2021
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. 45 Nov 8, 2021
StyleGAN2 - Official TensorFlow Implementation

StyleGAN2 - Official TensorFlow Implementation

NVIDIA Research Projects 8.7k Nov 26, 2021
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 88 Nov 19, 2021
Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

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

Matthias Wright 75 Nov 24, 2021
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 34 Nov 14, 2021
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 270 Dec 3, 2021
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 33 Nov 23, 2021
code for our paper "Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer"

SHOT++ Code for our TPAMI submission "Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer" that is ext

null 39 Nov 29, 2021