stylegan3
https://github.com/NVlabs/stylegan3
Set up conda environment to run the examples from the github readme.
For example, to run
# Train StyleGAN2 for FFHQ at 1024x1024 resolution using 8 GPUs.
python train.py --outdir=~/training-runs --cfg=stylegan2 --data=~/datasets/ffhq-1024x1024.zip \
--gpus=8 --batch=32 --gamma=10 --mirror=1 --aug=noaug
conda environment: stylegan3
mkdir local_data
cd local_data
git clone https://github.com/NVlabs/stylegan3.git
cd stylegan3
conda env create -f environment.yml
conda install ipython
Download stylegan3
mkdir local_data
cd local_data
git clone https://github.com/NVlabs/stylegan3.git
Download packages
cd stylegan3
conda env create -f environment.yml
conda activate stylegan3
To utilize datasets from huggingface:
pip install datasets
To prevent the error "ModuleNotFoundError: No module named 'psutil'":"
conda install -c conda-forge psutil -y
To run the Jeff Heaton examples in chapter 7:
conda install ipython
conda install -c conda-forge jupyter -y
Don't
conda install -c conda-forge tensorboard -y
because it causes the training to crash with
AttributeError: module 'distutils' has no attribute 'version'
On Ubuntu Server 24.04, after installing as above, when calling train.py, get error
Error building extension 'bias_act_plugin'
Solution:
Remove ninja that was installed using the environment.yml file by
conda remove ninja
This will somehow update a few packages and update pytorch from 1.9.1 to 2.5.1
and install ninja via conda without giving version number
conda install -c conda-forge ninja -y
https://stackoverflow.com/questions/75515629/how-to-build-the-bias-act-plugin-extension-for-stylegan3
Preparing flickrfaces dataset
Download the flickrfaces dataset:
https://github.com/NVlabs/ffhq-dataset/tree/master
Running the download script leads to an error:
OSError: [Errno Incorrect file size] ffhq-dataset-v2.json
Solution:
https://github.com/NVlabs/stylegan2-ada/issues/115
Open a browser at
https://drive.usercontent.google.com/download?id=16N0RV4fHI6joBuKbQAoG34V_cQk7vxSA&export=download
Download the file named ffhq-dataset-v2.json.
Place the file ffhq-dataset-v2.json and the script named download_ffhq.py in the same directory
Run the script with
python3 download_ffhq.py --json --images