-
Notifications
You must be signed in to change notification settings - Fork 612
Expand file tree
/
Copy pathsetup_and_train.sh
More file actions
executable file
·30 lines (24 loc) · 982 Bytes
/
setup_and_train.sh
File metadata and controls
executable file
·30 lines (24 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
set -euo pipefail
# Reproducible setup + train helper for flow reconstruction diffusion.
# Run this inside a PhysicsNeMo environment.
#
# Optional environment variables:
# CONFIG_NAME (default: config_dfsr_train)
# TRAIN_EXTRA_ARGS (default: empty; appended to train.py)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIG_NAME="${CONFIG_NAME:-config_dfsr_train}"
TRAIN_EXTRA_ARGS="${TRAIN_EXTRA_ARGS:-}"
echo ">>> [0/3] Entering ${SCRIPT_DIR}"
cd "${SCRIPT_DIR}"
echo ">>> [1/3] Installing dependencies"
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
echo ">>> [2/3] Starting training with --config-name ${CONFIG_NAME}"
if [[ -n "${TRAIN_EXTRA_ARGS}" ]]; then
# shellcheck disable=SC2086
python train.py --config-name "${CONFIG_NAME}" ${TRAIN_EXTRA_ARGS}
else
python train.py --config-name "${CONFIG_NAME}"
fi
echo ">>> [3/3] Done. Check configured output directory for logs and snapshots."