improve run.sh
This commit is contained in:
14
run.sh
14
run.sh
@@ -1,8 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CONFIG=$1
|
||||
GPUS=$2
|
||||
TASK=$2
|
||||
GPUS=$3
|
||||
|
||||
# CUDA_VISIBLE_DEVICES=$GPUS \
|
||||
PYTHONPATH=.:$PYTHONPATH OMP_NUM_THREADS=1 python -m torch.distributed.launch --nproc_per_node="$GPUS" \
|
||||
main.py train "$CONFIG" --backup_config --setup_output_dir --setup_random_seed
|
||||
_command="print(len('${GPUS}'.split(',')))"
|
||||
GPU_COUNT=$(python3 -c "${_command}")
|
||||
|
||||
echo "GPU_COUNT:${GPU_COUNT}"
|
||||
|
||||
CUDA_VISIBLE_DEVICES=$GPUS \
|
||||
PYTHONPATH=.:$PYTHONPATH OMP_NUM_THREADS=1 python -m torch.distributed.launch --nproc_per_node="$GPU_COUNT" \
|
||||
main.py "$TASK" "$CONFIG" --backup_config --setup_output_dir --setup_random_seed
|
||||
|
||||
Reference in New Issue
Block a user