StyleGAN 架构解读(重读StyleGAN)精【4】代码运行

 pytorch:https://github.com/rosinality/style-based-gan-pytorch

别人的代码分析:StyleGAN 代码分析


1、数据准备

You should prepare lmdb dataset,This will convert images to jpeg and pre-resizes it. (For example, 8/16/32/64/128/256/512/1024) Then you can train StyleGAN.:

python prepare_data.py --out LMDB_PATH --n_worker N_WORKER DATASET_PATH

--out:将图像输出的处理好的lmdb文件,
--n_worker:多少个线程处理?如果你的CPU是8核16线程,那么你设置16就将CPU用到了100%;

2、怎么train起来?

python train.py --mixing data/out --max_size 256 --ckpt checkpoint/train_step-5.model --init_size 128

--mining data/out :是你处理好的数据;
--max_size:最多生成多少分辨率停止;
--ckpt:使用的上次的train的model(resume);
--init_size:resume的时候从多少分辨率开始训练?如果不指定那就是8*8;

猜你喜欢

转载自blog.csdn.net/weixin_43135178/article/details/127320200