Created
August 13, 2022 19:02
-
-
Save zhaoyanpeng/3cfaddbc5c7c8c7aeb20e5410bb75930 to your computer and use it in GitHub Desktop.
Evaluate an AT model on AT retrieval tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/sh | |
| root=./ | |
| export OMP_NUM_THREADS=32 | |
| export CUDA_VISIBLE_DEVICES=$2 | |
| run_type=$1 | |
| gpu_list=(${CUDA_VISIBLE_DEVICES//,/ }) | |
| port=$(expr $RANDOM + 1000) | |
| ngpu=${#gpu_list[@]} | |
| mode="dp" | |
| num_proc=8 | |
| echo "GPUs: "$CUDA_VISIBLE_DEVICES "#"$ngpu "PORT: "$port | |
| # eval retrieval (AT) model | |
| # bash bash/run_retrieval.sh clotho 3 | |
| eval="retrieval" | |
| # the AT fine-tuning experiment name | |
| model_name="test" | |
| # the \d+.pth file has to be in $root/$model_name/ | |
| # https://storage.googleapis.com/ai2-mosaic-public/projects/vipant/model/01FM2Y9HJ896B2G6NKRXTEVXZ7/00006210.pth | |
| model_file="00006210.pth" | |
| echo "eval the model $model_file" | |
| mtask="model_root=$root model_file=$model_file model_name=$model_name eval=True | |
| verbose=False monitor=LAMonitor worker=CLAP port=$port num_gpus=$ngpu mode=$mode num_proc=$num_proc | |
| +model/image=vit_val +model/audio=vit_val +model/text=transformer_val +model/loss=ce +optimizer=standard +running/audio=default | |
| model.image.pre_encoder.patch_size=32 model.audio.pre_encoder.patch_size=32 model.audio.pre_encoder.stride=[16,24] running.clip_model_name=ViT-B32 | |
| running.retrieval=True | |
| running.audio.norms=[-4.93839311,5.75751113] | |
| running.eval_name=clotho_captions_evaluation running.eval_samples=1e9 | |
| running.prompt=\"\" running.batch_size=64 running.audio.max_len=1000 | |
| running.audio.audio_transforms=[] running.audio.fbank_transforms=[]" | |
| # config | |
| extra="$mtask" | |
| python train.py +running=$run_type $extra |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment