PWM / PWM_code /policy_rl /act /launch_act_train.sh
hchen657Naza's picture
Add files using upload-large-folder tool
23e1f91 verified
Raw History Blame Contribute Delete
1.28 kB
#!/usr/bin/env bash
# Train an ACT base policy (CVAE, chunk25). Pick the GPU via CUDA_VISIBLE_DEVICES.
# Usage:
# CUDA_VISIBLE_DEVICES=0 bash launch_act_train.sh sim_open_laptop_100demos open_laptop_100demos_chunk25
# Overrides: EPOCHS (10000), CHUNK (25), BS (8), PY.
set -e
TASK="${1:?task_name (a key in act/constants.py SIM_TASK_CONFIGS)}"
RUN="${2:?ckpt subdir name under /data0/hongyi/act_runs}"
EPOCHS="${EPOCHS:-10000}"; CHUNK="${CHUNK:-25}"; BS="${BS:-8}"
PY="${PY:-/home/hongyi/miniconda3/envs/pwm/bin/python}"
CKPT="/data0/hongyi/act_runs/${RUN}"
LOG="/home/hongyi/PWM/policy_rl/training_logs/act_${RUN}.log"
mkdir -p "$CKPT" "$(dirname "$LOG")"
cd /home/hongyi/PWM/policy_rl/act
# act/ for constants/utils/policy/detr; act/detr for DETR's internal `util`/`models` imports
export PYTHONPATH="/home/hongyi/PWM/policy_rl/act:/home/hongyi/PWM/policy_rl/act/detr:${PYTHONPATH}"
echo "=== ACT train: task=$TASK ckpt=$CKPT GPU=$CUDA_VISIBLE_DEVICES epochs=$EPOCHS chunk=$CHUNK bs=$BS"
nohup $PY imitate_episodes.py \
--task_name "$TASK" --ckpt_dir "$CKPT" --policy_class ACT \
--batch_size $BS --seed 0 --num_epochs $EPOCHS --lr 1e-5 \
--kl_weight 10 --chunk_size $CHUNK --hidden_dim 512 --dim_feedforward 3200 \
> "$LOG" 2>&1 &
echo "trainer pid=$! log=$LOG"