Skip to content

Commit

Permalink
train script
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoh01 committed Nov 27, 2024
1 parent 31bebe3 commit cf994e6
Show file tree
Hide file tree
Showing 2 changed files with 209 additions and 0 deletions.
104 changes: 104 additions & 0 deletions semantic-diffusion-model/scripts_train/consep_multi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Training
export OPENAI_LOGDIR='OUTPUT/consep_multi-SDM-256CH' \
# mpiexec -n 8
python image_train.py \
--data_dir /Dataset/consep \
--dataset_mode consep \
--lr 1e-4 \
--batch_size 16 \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--use_checkpoint True \
--num_classes 5 \
--class_cond True \
--no_instance False \
--save_interval 100 \
--gpu 1

# Classifier-free Finetune
export OPENAI_LOGDIR='OUTPUT/consep-SDM-256CH-FINETUNE'
python image_train.py \
--data_dir /Dataset/consep \
--dataset_mode consep \
--lr 2e-5 \
--batch_size 16 \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--use_checkpoint True \
--num_classes 5 \
--class_cond True \
--drop_rate 0.2 \
--no_instance False \
--resume_checkpoint OUTPUT/consep-SDM-256CH-FINETUNE/model005900.pt \
--save_interval 100 \
--gpu 3

# Testing (orig SDM)
export OPENAI_LOGDIR='OUTPUT/consep-SDM-256CH-TEST'
python image_sample.py \
--data_dir /Dataset/consep \
--dataset_mode consep \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--num_classes 5 \
--class_cond True \
--batch_size 2 \
--num_samples 3 \
--no_instance False \
--model_path OUTPUT/consep-SDM-256CH-FINETUNE/ema_0.9999_010000.pt \
--results_path RESULTS/consep-SDM-256CH --s 1.5 \
--use_ddim \
--gpu 2

# Testing
export OPENAI_LOGDIR='OUTPUT/consep-SDM-256CH-TEST'
python image_sample_repaint.py \
--data_dir /Dataset/consep \
--dataset_mode consep \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--num_classes 5 \
--class_cond True \
--batch_size 2 \
--num_samples 3 \
--no_instance False \
--model_path OUTPUT/consep-SDM-256CH-FINETUNE/ema_0.9999_010000.pt \
--results_path RESULTS/consep-SDM-256CH \
--s 1.5 \
--gpu 2
105 changes: 105 additions & 0 deletions semantic-diffusion-model/scripts_train/glysac_multi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Training
export OPENAI_LOGDIR='OUTPUT/glysac-SDM-256CH'
# mpiexec -n 8
python image_train.py \
--data_dir /Dataset/glysac \
--dataset_mode glysac \
--lr 1e-4 \
--batch_size 16 \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--use_checkpoint True \
--num_classes 4 \
--class_cond True \
--no_instance False \
--save_interval 120 \
--gpu 0

# Classifier-free Finetune
export OPENAI_LOGDIR='OUTPUT/glysac-SDM-256CH-FINETUNE'
python image_train.py \
--data_dir /Dataset/glysac \
--dataset_mode glysac \
--lr 2e-5 \
--batch_size 16 \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--use_checkpoint True \
--num_classes 4 \
--class_cond True \
--drop_rate 0.2 \
--no_instance False \
--resume_checkpoint OUTPUT/glysac-SDM-256CH-FINETUNE/model009480.pt \
--save_interval 120 \
--gpu 1

# Testing (orig SDM)
export OPENAI_LOGDIR='OUTPUT/glysac-SDM-256CH-TEST'
python image_sample.py \
--data_dir /Dataset/glysac \
--dataset_mode glysac \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--num_classes 4 \
--class_cond True \
--batch_size 2 \
--num_samples 3 \
--no_instance False \
--model_path OUTPUT/glysac-SDM-256CH-FINETUNE/ema_0.9999_010200.pt \
--results_path RESULTS/glysac-SDM-256CH \
--s 2.0 \
--use_ddim \
--gpu 2

# Testing
export OPENAI_LOGDIR='OUTPUT/glysac-SDM-256CH-TEST-fgbg'
python image_sample_repaint.py \
--data_dir /Dataset/glysac \
--dataset_mode glysac \
--attention_resolutions 32,16,8 \
--diffusion_steps 1000 \
--image_size 256 \
--learn_sigma True \
--noise_schedule linear \
--num_channels 256 \
--num_head_channels 64 \
--num_res_blocks 2 \
--resblock_updown True \
--use_fp16 True \
--use_scale_shift_norm True \
--num_classes 4 \
--class_cond True \
--batch_size 2 \
--num_samples 3 \
--no_instance False \
--model_path OUTPUT/glysac-SDM-256CH-FINETUNE/ema_0.9999_010200.pt \
--results_path RESULTS/glysac-SDM-256CH \
--s 2.0 \
--gpu 2

0 comments on commit cf994e6

Please sign in to comment.