| #!/bin/bash |
| |
| |
|
|
| set -e |
|
|
| data_root=/opt/tiger/xiaomoguhzz/standard_coco |
| pretrain_ckpt=/opt/tiger/xiaomoguhzz/EVA02_CLIP_B_psz16_s8B.pt |
|
|
| |
| |
| |
| |
| EXPERIMENT=${1:-"all"} |
|
|
| resume_integrated() { |
| local exp_name=$1 |
| local version=$2 |
| local resume_ckpt="logs/${exp_name}/checkpoints/epoch_5.pt" |
| |
| if [ ! -f "$resume_ckpt" ]; then |
| echo "Checkpoint not found: $resume_ckpt" |
| return 1 |
| fi |
| |
| echo "==============================================" |
| echo "Resuming: $exp_name" |
| echo "Checkpoint: $resume_ckpt" |
| echo "==============================================" |
| |
| CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 torchrun --nproc_per_node 8 --master_port 12349 \ |
| -m training.main \ |
| --batch-size=2 \ |
| --lr=1e-5 \ |
| --wd=0.1 \ |
| --epochs=6 \ |
| --workers=4 \ |
| --model EVA02-CLIP-B-16 \ |
| --pretrained eva \ |
| --warmup 1000 \ |
| --zeroshot-frequency 6 \ |
| --dataset-type grid_distill \ |
| --test-type coco_panoptic \ |
| --train-data ${data_root}/annotations/instances_train2017.json \ |
| --val-data ${data_root}/annotations/panoptic_val2017.json \ |
| --embed-path metadata/coco_panoptic_clip_hand_craft_EVACLIP_ViTB16.npy \ |
| --train-image-root ${data_root}/train2017 \ |
| --val-image-root ${data_root}/val2017 \ |
| --cache-dir ${pretrain_ckpt} \ |
| --log-every-n-steps 100 \ |
| --lock-image \ |
| --save-frequency 1 \ |
| --lock-image-unlocked-groups 12 \ |
| --name ${exp_name} \ |
| --downsample-factor 16 \ |
| --det-image-size 560 \ |
| --val-segm-root ${data_root}/annotations/panoptic_val2017 \ |
| --alpha 0.7 \ |
| --mode vanilla \ |
| --use_vfm dinov2-B \ |
| --loss_context_weight 1.0 \ |
| --loss_content_weight 1.0 \ |
| --loss_region_weight 0.05 \ |
| --repa_layer_idx -1 \ |
| --version ${version} \ |
| --resume ${resume_ckpt} |
| } |
|
|
| cd /opt/tiger/xiaomoguhzz/DeCLIP_private |
|
|
| case $EXPERIMENT in |
| "1"|"integrated") |
| resume_integrated "Integrated_EVA-B_DINOv2-B_560" "integrated" |
| ;; |
| "2"|"grad_analysis") |
| resume_integrated "Integrated_EVA-B_DINOv2-B_560_grad_analysis" "integrated_grad_analysis" |
| ;; |
| "all") |
| echo "Resuming all experiments sequentially..." |
| resume_integrated "Integrated_EVA-B_DINOv2-B_560" "integrated" |
| resume_integrated "Integrated_EVA-B_DINOv2-B_560_grad_analysis" "integrated_grad_analysis" |
| ;; |
| *) |
| echo "Usage: $0 [1|integrated|2|grad_analysis|all]" |
| echo " 1/integrated - Resume Integrated_EVA-B_DINOv2-B_560" |
| echo " 2/grad_analysis - Resume Integrated_EVA-B_DINOv2-B_560_grad_analysis" |
| echo " all - Resume all experiments" |
| exit 1 |
| ;; |
| esac |
|
|
| echo "Done!" |
|
|