VINN small and baseline commands
这个提交包含在:
129
commands.txt
129
commands.txt
@ -205,7 +205,56 @@ CUDA_VISIBLE_DEVICES=1 python3 imitate_episodes.py \
|
|||||||
--batch_size 32 --lr 1e-4 --seed 0 \
|
--batch_size 32 --lr 1e-4 --seed 0 \
|
||||||
--num_steps 1000000 --eval_every 1000000 --validate_every 5000 --save_every 5000
|
--num_steps 1000000 --eval_every 1000000 --validate_every 5000 --save_every 5000
|
||||||
|
|
||||||
|
# try chunk size 64, no cotrain
|
||||||
|
|
||||||
|
conda activate mobile
|
||||||
|
export MUJOCO_GL=egl
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
CUDA_VISIBLE_DEVICES=0 python3 imitate_episodes.py \
|
||||||
|
--task_name aloha_mobile_wipe_wine \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/wipe_wine_diffusion_augmentation_chunk64_seed0 \
|
||||||
|
--policy_class Diffusion --chunk_size 64 \
|
||||||
|
--batch_size 32 --lr 1e-4 --seed 0 \
|
||||||
|
--num_steps 1000000 --eval_every 1000000 --validate_every 5000 --save_every 5000
|
||||||
|
|
||||||
|
# chunk 64 with cotrain
|
||||||
|
|
||||||
|
conda activate mobile
|
||||||
|
export MUJOCO_GL=egl
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
CUDA_VISIBLE_DEVICES=1 python3 imitate_episodes.py \
|
||||||
|
--task_name aloha_mobile_wipe_wine_cotrain \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/wipe_wine_cotrain_diffusion_augmentation_chunk64_seed0 \
|
||||||
|
--policy_class Diffusion --chunk_size 64 \
|
||||||
|
--batch_size 32 --lr 1e-4 --seed 0 \
|
||||||
|
--num_steps 1000000 --eval_every 1000000 --validate_every 5000 --save_every 5000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# chunk 64 with cotrain + EMA
|
||||||
|
|
||||||
|
conda activate mobile
|
||||||
|
export MUJOCO_GL=egl
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
CUDA_VISIBLE_DEVICES=0 python3 imitate_episodes.py \
|
||||||
|
--task_name aloha_mobile_wipe_wine_2_cotrain \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/wipe_wine_cotrain_diffusion_augmentation_chunk64_ema_seed0 \
|
||||||
|
--policy_class Diffusion --chunk_size 64 \
|
||||||
|
--batch_size 32 --lr 1e-4 --seed 0 \
|
||||||
|
--num_steps 1000000 --eval_every 1000000 --validate_every 5000 --save_every 5000
|
||||||
|
|
||||||
|
|
||||||
|
# chunk 64 with cotrain + EMA + 3e-4
|
||||||
|
|
||||||
|
conda activate mobile
|
||||||
|
export MUJOCO_GL=egl
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
CUDA_VISIBLE_DEVICES=1 python3 imitate_episodes.py \
|
||||||
|
--task_name aloha_mobile_wipe_wine_2_cotrain \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/wipe_wine_cotrain_diffusion_augmentation_chunk64_ema_3e-4_seed0 \
|
||||||
|
--policy_class Diffusion --chunk_size 64 \
|
||||||
|
--batch_size 32 --lr 3e-4 --seed 0 \
|
||||||
|
--num_steps 1000000 --eval_every 1000000 --validate_every 5000 --save_every 5000
|
||||||
|
|
||||||
|
|
||||||
######################## VINN ########################
|
######################## VINN ########################
|
||||||
@ -351,9 +400,6 @@ python3 vinn_cache_feature.py --ckpt_path /home/tonyzhao/Research/act-plus-plus/
|
|||||||
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME}
|
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
conda activate mobile
|
conda activate mobile
|
||||||
export CUDA_VISIBLE_DEVICES=1
|
export CUDA_VISIBLE_DEVICES=1
|
||||||
cd /home/tonyzhao/Research/act-plus-plus
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
@ -372,6 +418,83 @@ python3 vinn_cache_feature.py --ckpt_path /home/tonyzhao/Research/act-plus-plus/
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# push chair task
|
||||||
|
|
||||||
|
conda activate mobile
|
||||||
|
export CUDA_VISIBLE_DEVICES=0
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning
|
||||||
|
python3 train.py --task aloha_mobile_chair_truncated --cam_name cam_high --seed 0
|
||||||
|
python3 train.py --task aloha_mobile_chair_truncated --cam_name cam_left_wrist --seed 0
|
||||||
|
python3 train.py --task aloha_mobile_chair_truncated --cam_name cam_right_wrist --seed 0
|
||||||
|
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
TASK_NAME=aloha_mobile_chair_truncated
|
||||||
|
DATA_NAME=aloha_mobile_chair_truncated
|
||||||
|
python3 vinn_cache_feature.py --ckpt_path /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning/byol-${TASK_NAME}-DUMMY-seed-0.pt \
|
||||||
|
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
conda activate mobile
|
||||||
|
export CUDA_VISIBLE_DEVICES=1
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning
|
||||||
|
python3 train.py --task aloha_mobile_chair_truncated_cotrain --cam_name cam_high --seed 0
|
||||||
|
python3 train.py --task aloha_mobile_chair_truncated_cotrain --cam_name cam_left_wrist --seed 0
|
||||||
|
python3 train.py --task aloha_mobile_chair_truncated_cotrain --cam_name cam_right_wrist --seed 0
|
||||||
|
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
TASK_NAME=aloha_mobile_chair_truncated_cotrain
|
||||||
|
DATA_NAME=aloha_mobile_chair_truncated
|
||||||
|
python3 vinn_cache_feature.py --ckpt_path /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning/byol-${TASK_NAME}-DUMMY-seed-0.pt \
|
||||||
|
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME}
|
||||||
|
|
||||||
|
|
||||||
|
# cache feature again for wipe wine
|
||||||
|
|
||||||
|
conda activate mobile
|
||||||
|
export CUDA_VISIBLE_DEVICES=0
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
TASK_NAME=aloha_mobile_wipe_wine
|
||||||
|
DATA_NAME=aloha_mobile_wipe_wine
|
||||||
|
python3 vinn_cache_feature.py --ckpt_path /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning/byol-${TASK_NAME}-DUMMY-seed-0.pt \
|
||||||
|
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME}
|
||||||
|
|
||||||
|
cd /home/tonyzhao/Research/act-plus-plus
|
||||||
|
TASK_NAME=aloha_mobile_wipe_wine_cotrain
|
||||||
|
DATA_NAME=aloha_mobile_wipe_wine
|
||||||
|
python3 vinn_cache_feature.py --ckpt_path /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning/byol-${TASK_NAME}-DUMMY-seed-0.pt \
|
||||||
|
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# run on real robot
|
||||||
|
|
||||||
|
TASK_NAME=aloha_mobile_chair_truncated
|
||||||
|
python3 vinn_select_k.py \
|
||||||
|
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME} \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/VINN-eval-${TASK_NAME}-seed-0
|
||||||
|
|
||||||
|
python3 vinn_eval.py \
|
||||||
|
--dataset_dir /scr/tonyzhao/datasets/sim_transfer_cube_scripted \
|
||||||
|
--model_dir /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning/byol-${TASK_NAME}-DUMMY-seed-0.pt \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/VINN-eval-${TASK_NAME}-seed-0 \
|
||||||
|
--task_name $TASK_NAME
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TASK_NAME=aloha_mobile_chair_truncated
|
||||||
|
python3 vinn_select_k.py \
|
||||||
|
--dataset_dir /scr/tonyzhao/mobile_aloha_datasets/${DATA_NAME} \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/VINN-eval-${TASK_NAME}-seed-0
|
||||||
|
|
||||||
|
python3 vinn_eval.py \
|
||||||
|
--dataset_dir /scr/tonyzhao/datasets/sim_transfer_cube_scripted \
|
||||||
|
--model_dir /home/tonyzhao/Research/act-plus-plus/byol_pytorch/examples/lightning/byol-${TASK_NAME}-DUMMY-seed-0.pt \
|
||||||
|
--ckpt_dir /scr/tonyzhao/train_logs/VINN-eval-${TASK_NAME}-seed-0 \
|
||||||
|
--task_name $TASK_NAME
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# eval on real robot
|
# eval on real robot
|
||||||
|
|
||||||
conda activate aloha
|
conda activate aloha
|
||||||
|
|||||||
@ -38,6 +38,9 @@ def main(args):
|
|||||||
repr_type = ckpt_name.split('-')[0]
|
repr_type = ckpt_name.split('-')[0]
|
||||||
seed = int(ckpt_name.split('-')[-1][:-3])
|
seed = int(ckpt_name.split('-')[-1][:-3])
|
||||||
|
|
||||||
|
if 'cotrain' in ckpt_name:
|
||||||
|
repr_type += '_cotrain'
|
||||||
|
|
||||||
episode_idxs = [int(name.split('_')[1].split('.')[0]) for name in os.listdir(dataset_dir) if ('.hdf5' in name) and ('features' not in name)]
|
episode_idxs = [int(name.split('_')[1].split('.')[0]) for name in os.listdir(dataset_dir) if ('.hdf5' in name) and ('features' not in name)]
|
||||||
episode_idxs.sort()
|
episode_idxs.sort()
|
||||||
assert len(episode_idxs) == episode_idxs[-1] + 1 # no holes
|
assert len(episode_idxs) == episode_idxs[-1] + 1 # no holes
|
||||||
@ -48,6 +51,7 @@ def main(args):
|
|||||||
for episode_idx in range(num_episodes):
|
for episode_idx in range(num_episodes):
|
||||||
|
|
||||||
# load all images
|
# load all images
|
||||||
|
print(f'loading data')
|
||||||
dataset_path = os.path.join(dataset_dir, f'episode_{episode_idx}.hdf5')
|
dataset_path = os.path.join(dataset_dir, f'episode_{episode_idx}.hdf5')
|
||||||
with h5py.File(dataset_path, 'r') as root:
|
with h5py.File(dataset_path, 'r') as root:
|
||||||
image_dict = {}
|
image_dict = {}
|
||||||
@ -63,6 +67,7 @@ def main(args):
|
|||||||
|
|
||||||
image_dict[cam_name] = image
|
image_dict[cam_name] = image
|
||||||
|
|
||||||
|
print(f'loading model')
|
||||||
# load pretrain nets after cam names are known
|
# load pretrain nets after cam names are known
|
||||||
if not feature_extractors:
|
if not feature_extractors:
|
||||||
for cam_name in camera_names:
|
for cam_name in camera_names:
|
||||||
|
|||||||
@ -97,6 +97,11 @@ def main(args):
|
|||||||
model_name = pathlib.PurePath(model_dir).name
|
model_name = pathlib.PurePath(model_dir).name
|
||||||
seed = int(model_name.split('-')[-1][:-3])
|
seed = int(model_name.split('-')[-1][:-3])
|
||||||
|
|
||||||
|
repr_type = 'byol'
|
||||||
|
if 'cotrain' in model_name:
|
||||||
|
repr_type += '_cotrain'
|
||||||
|
e() # make sure!
|
||||||
|
|
||||||
k = ks[seed]
|
k = ks[seed]
|
||||||
|
|
||||||
if real_robot:
|
if real_robot:
|
||||||
@ -118,7 +123,7 @@ def main(args):
|
|||||||
# Visual feature
|
# Visual feature
|
||||||
all_cam_feature = []
|
all_cam_feature = []
|
||||||
for cam_name in camera_names:
|
for cam_name in camera_names:
|
||||||
feature_dataset_path = os.path.join(dataset_dir, f'byol_features_seed{seed}_episode_{episode_id}.hdf5')
|
feature_dataset_path = os.path.join(dataset_dir, f'{repr_type}_features_seed{seed}_episode_{episode_id}.hdf5')
|
||||||
with h5py.File(feature_dataset_path, 'r') as root:
|
with h5py.File(feature_dataset_path, 'r') as root:
|
||||||
cam_feature = root[f'/features/{cam_name}'][:]
|
cam_feature = root[f'/features/{cam_name}'][:]
|
||||||
all_cam_feature.append(cam_feature)
|
all_cam_feature.append(cam_feature)
|
||||||
|
|||||||
@ -48,6 +48,11 @@ def main(args):
|
|||||||
batch_size = 100
|
batch_size = 100
|
||||||
# TODO ######################
|
# TODO ######################
|
||||||
|
|
||||||
|
repr_type = 'byol'
|
||||||
|
if 'cotrain' in ckpt_dir:
|
||||||
|
repr_type += '_cotrain'
|
||||||
|
e() # make sure!
|
||||||
|
|
||||||
if not os.path.isdir(ckpt_dir):
|
if not os.path.isdir(ckpt_dir):
|
||||||
os.makedirs(ckpt_dir)
|
os.makedirs(ckpt_dir)
|
||||||
|
|
||||||
@ -67,7 +72,7 @@ def main(args):
|
|||||||
camera_names = list(root[f'/observations/images/'].keys())
|
camera_names = list(root[f'/observations/images/'].keys())
|
||||||
|
|
||||||
all_cam_feature = []
|
all_cam_feature = []
|
||||||
feature_dataset_path = os.path.join(dataset_dir, f'byol_features_seed{seed}_episode_{episode_id}.hdf5')
|
feature_dataset_path = os.path.join(dataset_dir, f'{repr_type}_features_seed{seed}_episode_{episode_id}.hdf5')
|
||||||
with h5py.File(feature_dataset_path, 'r') as root:
|
with h5py.File(feature_dataset_path, 'r') as root:
|
||||||
for cam_name in camera_names:
|
for cam_name in camera_names:
|
||||||
cam_feature = root[f'/features/{cam_name}'][:]
|
cam_feature = root[f'/features/{cam_name}'][:]
|
||||||
@ -92,7 +97,7 @@ def main(args):
|
|||||||
action = root['/action'][:]
|
action = root['/action'][:]
|
||||||
|
|
||||||
all_cam_feature = []
|
all_cam_feature = []
|
||||||
feature_dataset_path = os.path.join(dataset_dir, f'byol_features_seed{seed}_episode_{episode_id}.hdf5')
|
feature_dataset_path = os.path.join(dataset_dir, f'{repr_type}_features_seed{seed}_episode_{episode_id}.hdf5')
|
||||||
with h5py.File(feature_dataset_path, 'r') as root:
|
with h5py.File(feature_dataset_path, 'r') as root:
|
||||||
for cam_name in camera_names:
|
for cam_name in camera_names:
|
||||||
cam_feature = root[f'/features/{cam_name}'][:]
|
cam_feature = root[f'/features/{cam_name}'][:]
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户