You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
2 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
# an example to do pre-training: (not that `/path/to/imagenet` should contain directories named `train` and `val`)
|
||
2 years ago
|
# > cd /path/to/SparK/downstream_imagenet
|
||
|
# > bash ./main.sh experiment_name --num_nodes=1 --ngpu_per_node=8 --node_rank=0 --master_address=128.0.0.0 --master_port=30000 --data_path=/path/to/imagenet --model=convnext_small
|
||
2 years ago
|
|
||
|
####### template begins #######
|
||
|
SCRIPTS_DIR=$(cd $(dirname $0); pwd)
|
||
|
cd "${SCRIPTS_DIR}"
|
||
2 years ago
|
FINETUNE_DIR=$(pwd)
|
||
|
echo "FINETUNE_DIR=${FINETUNE_DIR}"
|
||
2 years ago
|
|
||
|
shopt -s expand_aliases
|
||
|
alias python=python3
|
||
|
alias to_scripts_dir='cd "${SCRIPTS_DIR}"'
|
||
2 years ago
|
alias to_spark_dir='cd "${FINETUNE_DIR}"'
|
||
2 years ago
|
alias print='echo "$(date +"[%m-%d %H:%M:%S]") (exp.sh)=>"'
|
||
|
function mkd() {
|
||
|
mkdir -p "$1" >/dev/null 2>&1
|
||
|
}
|
||
|
####### template ends #######
|
||
|
|
||
|
|
||
|
EXP_NAME=$1
|
||
|
|
||
2 years ago
|
EXP_DIR="${FINETUNE_DIR}/output_${EXP_NAME}"
|
||
2 years ago
|
|
||
|
|
||
|
print "===================== Args ====================="
|
||
|
print "EXP_NAME: ${EXP_NAME}"
|
||
2 years ago
|
print "[other_args sent to launch.py]: ${*:2}"
|
||
2 years ago
|
print "================================================"
|
||
|
print ""
|
||
|
|
||
|
|
||
2 years ago
|
print "============== ImageNet finetuning starts =============="
|
||
2 years ago
|
to_spark_dir
|
||
2 years ago
|
touch ~/wait1
|
||
2 years ago
|
python launch.py \
|
||
|
--main_py_relpath main.py \
|
||
|
--exp_name "${EXP_NAME}" \
|
||
|
--exp_dir "${EXP_DIR}" \
|
||
2 years ago
|
"${*:2}"
|
||
2 years ago
|
print "============== ImageNet finetuning ends =============="
|
||
|
rm ~/wait1
|