|
|
|
|
@ -24,29 +24,29 @@ echo "Clearing output directory: $OUTPUT_DIR"
|
|
|
|
|
find "$OUTPUT_DIR" -mindepth 1 -delete
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
accelerate launch ../algorithms/aspl.py \
|
|
|
|
|
--pretrained_model_name_or_path=$MODEL_PATH \
|
|
|
|
|
--enable_xformers_memory_efficient_attention \
|
|
|
|
|
--instance_data_dir_for_train=$CLEAN_TRAIN_DIR \
|
|
|
|
|
--instance_data_dir_for_adversarial=$CLEAN_ADV_DIR \
|
|
|
|
|
--instance_prompt="a photo of sks person" \
|
|
|
|
|
--class_data_dir=$CLASS_DIR \
|
|
|
|
|
--num_class_images=200 \
|
|
|
|
|
--class_prompt="a photo of person" \
|
|
|
|
|
--output_dir=$OUTPUT_DIR \
|
|
|
|
|
--center_crop \
|
|
|
|
|
--with_prior_preservation \
|
|
|
|
|
--prior_loss_weight=1.0 \
|
|
|
|
|
--resolution=384 \
|
|
|
|
|
--train_batch_size=1 \
|
|
|
|
|
--max_train_steps=50 \
|
|
|
|
|
--max_f_train_steps=3 \
|
|
|
|
|
--max_adv_train_steps=6 \
|
|
|
|
|
--checkpointing_iterations=10 \
|
|
|
|
|
--learning_rate=5e-7 \
|
|
|
|
|
--pgd_alpha=0.005 \
|
|
|
|
|
--pgd_eps=8 \
|
|
|
|
|
--seed=0
|
|
|
|
|
accelerate launch --num_processes 1 --num_machines 1 ../algorithms/aspl.py \
|
|
|
|
|
--pretrained_model_name_or_path="$MODEL_PATH" \
|
|
|
|
|
--enable_xformers_memory_efficient_attention \
|
|
|
|
|
--instance_data_dir_for_train="$CLEAN_TRAIN_DIR" \
|
|
|
|
|
--instance_data_dir_for_adversarial="$CLEAN_ADV_DIR" \
|
|
|
|
|
--instance_prompt="a photo of sks person" \
|
|
|
|
|
--class_data_dir="$CLASS_DIR" \
|
|
|
|
|
--num_class_images=200 \
|
|
|
|
|
--class_prompt="a photo of person" \
|
|
|
|
|
--output_dir="$OUTPUT_DIR" \
|
|
|
|
|
--center_crop \
|
|
|
|
|
--with_prior_preservation \
|
|
|
|
|
--prior_loss_weight=1.0 \
|
|
|
|
|
--resolution=384 \
|
|
|
|
|
--train_batch_size=1 \
|
|
|
|
|
--max_train_steps=50 \
|
|
|
|
|
--max_f_train_steps=3 \
|
|
|
|
|
--max_adv_train_steps=6 \
|
|
|
|
|
--checkpointing_iterations=10 \
|
|
|
|
|
--learning_rate=5e-7 \
|
|
|
|
|
--pgd_alpha=0.005 \
|
|
|
|
|
--pgd_eps=8 \
|
|
|
|
|
--seed=0
|
|
|
|
|
|
|
|
|
|
# ------------------------- 训练后清空 CLASS_DIR -------------------------
|
|
|
|
|
# 注意:这会在 accelerate launch 成功结束后执行
|
|
|
|
|
|