kwonminki / Asyrp_official

official repo for Asyrp : Diffusion Models already have a Semantic Latent Space (ICLR2023)
MIT License
247 stars 20 forks source link

Need more detailed training & inference settings #6

Open Aria-Zhangjl opened 1 year ago

Aria-Zhangjl commented 1 year ago

Thanks for your work! I am trying to train Asyrp for animal face editing on my own device. For attribute 'Happ Dog' , the training setting is as below:

sh_file_name="script_train.sh"
gpu="7"

config="afhq.yml" # if you use other dataset, config/path_config.py should be matched
guid="dog_happy"

CUDA_VISIBLE_DEVICES=$gpu python main.py --run_train                        \
                        --config $config                                    \
                        --exp ./runs/$guid                                  \
                        --edit_attr $guid                                   \
                        --do_train 1                                        \
                        --do_test 1                                         \
                        --n_train_img 1000                                   \
                        --n_test_img 32                                     \
                        --n_iter 1                                          \
                        --bs_train 1                                        \
                        --t_0 999                                           \
                        --n_inv_step 40                                     \
                        --n_train_step 40                                   \
                        --n_test_step 1000                                   \
                        --get_h_num 1                                       \
                        --train_delta_block                                 \
                        --sh_file_name $sh_file_name                        \
                        --save_x0                                           \
                        --use_x0_tensor                                     \
                        --hs_coeff_delta_h 1.0                              \
                        --lr_training 0.5                                   \
                        --clip_loss_w 1.5                                   \
                        --l1_loss_w 3.0                                     \
                        --retrain 1                                         \
                        --sh_file_name "script_train.sh"                    \
                        --load_random_noise
                        --lpips_addnoise_th 1.2                           \ # if you compute lpips, use it.
                        --lpips_edit_th 0.33                              \
                        --add_noise_from_xt                               \ # if you compute lpips, use it.

However, the editing results are not so good. The changes are undistinguishable, some examples are shown below. image

I wonder could you privode a more detailed training & inference setting for 'Happ Dog'. ? Looking forward for your reply, Thank you!

dongxuyue commented 1 year ago

I've encountered a similar situation as yours. I loaded the official checkpoint with the default parameters provided by the author, but the generated image quality was very poor.

kwonminki commented 1 year ago

Thank you for asking about my code. I apologize for the delayed response. After reviewing my previous work on the AFHQ-dog dataset, I realized that there may have been some issues with the checkpoint I posted. Therefore, I want to ensure that I provide you with information.

To generate high-quality images on the AFHQ-dog dataset, careful experimental settings were necessary. Specifically, it was important to train the model using random noise as input and a relatively large batch size of approximately 32, and a large number of images-noise (more than 3000 random noises). Additionally, a large number of iterations were required to achieve optimal results.

Sorry for the incorrect training information.

I'll check the checkpoints and replace them.