Skip to content

Commit

Permalink
add script to run bulk finetuning exps
Browse files Browse the repository at this point in the history
  • Loading branch information
ngbountos committed Jun 22, 2023
1 parent ab43fd5 commit d06772c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions linear_eval.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "No root path. Setting up default!"
checkpoint_root_path="/mnt/shared_storage/hephaestus_checkpoints"
exit 1
fi
checkpoint_root_path=$1
checkpoints=($(ls $checkpoint_root_path))
checkpoint_pattern="checkpoint_"
for ((index=0;index<${#checkpoints[@]}; index++))
do
file_path="$checkpoint_root_path"/"${checkpoints[index]}"
files=($(ls $file_path))

filtered_files=$(printf '%s\n' "${files[@]}"| egrep "${checkpoint_pattern}" | sort)
last_checkpoint=$(echo "$filtered_files" | tail -n 1)
echo "Initializing experiment from checkpoint folder: " $file_path
config=$file_path/"config.json"
echo "SSL Encoder: " $last_checkpoint " and configuration file: " $config

last_checkpoint_full_path=$file_path/$last_checkpoint
for img_size in 224 448 560
do
python main.py --supervised=True --ssl_encoder_path=$last_checkpoint_full_path --ssl_config_path=$config --supervised_img_size=$img_size
done
done

0 comments on commit d06772c

Please sign in to comment.