Upload code/1028_run/tasks/train_only.sh with huggingface_hub
Browse files
code/1028_run/tasks/train_only.sh
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -uo pipefail
|
| 3 |
+
ROOT=/lustre/fsw/portfolios/nvr/users/jtremblay/yu
|
| 4 |
+
RUN=$ROOT/1028_run; TASKS=$ROOT/1027_sim_tasks
|
| 5 |
+
V5CODE=$TASKS/share_v5_sim2real_20260929/code
|
| 6 |
+
CONDA=$ROOT/miniconda3; UPY=$CONDA/envs/ur5dp/bin/python
|
| 7 |
+
TASK=${TASK:-battery}; NAME=${TASK}_v1
|
| 8 |
+
log() { echo "== $(date '+%F %T') [$TASK] $*"; }
|
| 9 |
+
FINAL=$RUN/data/${NAME}_1028
|
| 10 |
+
|
| 11 |
+
source $CONDA/etc/profile.d/conda.sh
|
| 12 |
+
kept=$($UPY -c "import json; d=json.load(open('$FINAL/collect_meta.json')); print(d['n_kept'])" 2>/dev/null || echo 0)
|
| 13 |
+
log "Training DP ($kept demos) with AMP + batch_size=256 + num_workers=16"
|
| 14 |
+
|
| 15 |
+
cd $V5CODE/ur5_lab_code && export PYTHONPATH=src:.
|
| 16 |
+
rm -f $V5CODE/train_runs/${NAME}_1028_aug_s0/logs.json.txt # clear old logs to allow fresh start
|
| 17 |
+
|
| 18 |
+
$UPY train.py --config-name=train_baseline_diffusion_unet task=sim_baseline \
|
| 19 |
+
task_name=${NAME}_1028 dataset_path=$FINAL n_demo=$kept \
|
| 20 |
+
training.device=cuda:0 training.seed=0 training.num_epochs=130 training.checkpoint_every=129 \
|
| 21 |
+
checkpoint.topk.k=0 training.resume=True checkpoint.save_last_ckpt=True \
|
| 22 |
+
+training.use_amp=True \
|
| 23 |
+
dataloader.batch_size=256 dataloader.num_workers=16 \
|
| 24 |
+
logging.mode=offline \
|
| 25 |
+
"policy._target_=algorithms.policy.diffusion_unet_baseline_aug_policy.DiffusionUnetBaselineAugPolicy" \
|
| 26 |
+
+policy.cam1_dropout=0.1 +policy.cam1_aug_p=0.5 +policy.cam1_erase_p=0.3 +policy.cam0_aug_p=0.3 \
|
| 27 |
+
"hydra.run.dir=$V5CODE/train_runs/${NAME}_1028_aug_s0" \
|
| 28 |
+
2>&1 | tee $RUN/logs/${NAME}_1028_train.log
|
| 29 |
+
rc=$?; log "Train exit $rc"
|
| 30 |
+
[ $rc -eq 0 ] && log "DONE: $V5CODE/train_runs/${NAME}_1028_aug_s0/checkpoints/" || { log "TRAIN FAILED"; exit 1; }
|