2023-02-18 02:46:44 +00:00
|
|
|
#!/bin/bash
|
2023-02-18 02:07:22 +00:00
|
|
|
source ./venv/bin/activate
|
2023-03-03 04:37:18 +00:00
|
|
|
|
|
|
|
GPUS=$1
|
|
|
|
CONFIG=$2
|
|
|
|
PORT=1234
|
|
|
|
|
|
|
|
if (( $GPUS > 1 )); then
|
|
|
|
python3 -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT ./src/train.py -opt "$CONFIG" --launcher=pytorch
|
|
|
|
else
|
|
|
|
python3 ./src/train.py -opt "$CONFIG"
|
|
|
|
fi
|
2023-02-18 02:07:22 +00:00
|
|
|
deactivate
|