-
Notifications
You must be signed in to change notification settings - Fork 2
Skillgen demo #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,236 @@ | ||
| { | ||
| "algo_name": "bc", | ||
| "experiment": { | ||
| "name": "vial_insert", | ||
| "validate": true, | ||
| "logging": { | ||
| "terminal_output_to_txt": true, | ||
| "log_tb": true, | ||
| "log_wandb": true, | ||
| "wandb_proj_name": "vial_insert" | ||
| }, | ||
| "save": { | ||
| "enabled": true, | ||
| "every_n_seconds": null, | ||
| "every_n_epochs": null, | ||
| "epochs": [], | ||
| "on_best_validation": true, | ||
| "on_best_rollout_return": true, | ||
| "on_best_rollout_success_rate": true | ||
| }, | ||
| "epoch_every_n_steps": 100, | ||
| "validation_epoch_every_n_steps": 10, | ||
| "env": "Dev-IK-Rel-Insert-v0", | ||
| "additional_envs": null, | ||
| "render": false, | ||
| "render_video": true, | ||
| "keep_all_videos": false, | ||
| "video_skip": 5, | ||
| "rollout": { | ||
| "enabled": false, | ||
| "n": 50, | ||
| "horizon": 400, | ||
| "rate": 50, | ||
| "warmstart": 0, | ||
| "terminate_on_success": true | ||
| }, | ||
| "env_meta_update_dict": {}, | ||
| "ckpt_path": null | ||
| }, | ||
| "train": { | ||
| "data": [ | ||
| { | ||
| "path": "docs/insert/glassware_lift_demos_generated_split.hdf5" | ||
| } | ||
| ], | ||
| "output_dir": "/workspace/isaaclab/robomimic/Dev-IK-Rel-Insert-v0/model14/", | ||
| "normalize_weights_by_ds_size": false, | ||
| "num_data_workers": 4, | ||
| "hdf5_cache_mode": "low_dim", | ||
| "hdf5_use_swmr": true, | ||
| "hdf5_load_next_obs": false, | ||
| "hdf5_normalize_obs": false, | ||
| "hdf5_filter_key": "train", | ||
| "hdf5_validation_filter_key": "valid", | ||
| "seq_length": 16, | ||
| "pad_seq_length": true, | ||
| "frame_stack": 1, | ||
| "pad_frame_stack": true, | ||
| "dataset_keys": [ | ||
| "actions", | ||
| "rewards", | ||
| "dones" | ||
| ], | ||
| "action_keys": [ | ||
| "actions" | ||
| ], | ||
| "action_config": { | ||
| "actions": { | ||
| "normalization": null | ||
| } | ||
| }, | ||
| "goal_mode": null, | ||
| "cuda": true, | ||
| "batch_size": 100, | ||
| "num_epochs": 1000, | ||
| "seed": 101, | ||
| "max_grad_norm": null | ||
| }, | ||
| "algo": { | ||
| "optim_params": { | ||
| "policy": { | ||
| "optimizer_type": "adam", | ||
| "learning_rate": { | ||
| "initial": 0.0001, | ||
| "decay_factor": 0.01, | ||
| "epoch_schedule": [], | ||
| "scheduler_type": "multistep" | ||
| }, | ||
| "regularization": { | ||
| "L2": 0.0 | ||
| } | ||
| } | ||
| }, | ||
| "loss": { | ||
| "l2_weight": 1.0, | ||
| "l1_weight": 0.0, | ||
| "cos_weight": 0.0 | ||
| }, | ||
| "actor_layer_dims": [ | ||
| 1024, | ||
| 1024 | ||
| ], | ||
| "gaussian": { | ||
| "enabled": false, | ||
| "fixed_std": false, | ||
| "init_std": 0.1, | ||
| "min_std": 0.01, | ||
| "std_activation": "softplus", | ||
| "low_noise_eval": true | ||
| }, | ||
| "gmm": { | ||
| "enabled": true, | ||
| "num_modes": 10, | ||
| "min_std": 0.0001, | ||
| "std_activation": "softplus", | ||
| "low_noise_eval": true | ||
| }, | ||
| "vae": { | ||
| "enabled": false, | ||
| "latent_dim": 14, | ||
| "latent_clip": null, | ||
| "kl_weight": 1.0, | ||
| "decoder": { | ||
| "is_conditioned": true, | ||
| "reconstruction_sum_across_elements": false | ||
| }, | ||
| "prior": { | ||
| "learn": false, | ||
| "is_conditioned": false, | ||
| "use_gmm": false, | ||
| "gmm_num_modes": 10, | ||
| "gmm_learn_weights": false, | ||
| "use_categorical": false, | ||
| "categorical_dim": 10, | ||
| "categorical_gumbel_softmax_hard": false, | ||
| "categorical_init_temp": 1.0, | ||
| "categorical_temp_anneal_step": 0.001, | ||
| "categorical_min_temp": 0.3 | ||
| }, | ||
| "encoder_layer_dims": [ | ||
| 300, | ||
| 400 | ||
| ], | ||
| "decoder_layer_dims": [ | ||
| 300, | ||
| 400 | ||
| ], | ||
| "prior_layer_dims": [ | ||
| 300, | ||
| 400 | ||
| ] | ||
| }, | ||
| "rnn": { | ||
| "enabled": true, | ||
| "horizon": 100, | ||
| "hidden_dim": 400, | ||
| "rnn_type": "LSTM", | ||
| "num_layers": 2, | ||
| "open_loop": false, | ||
| "kwargs": { | ||
| "bidirectional": false | ||
| } | ||
| }, | ||
| "transformer": { | ||
| "enabled": false, | ||
| "context_length": 10, | ||
| "embed_dim": 512, | ||
| "num_layers": 6, | ||
| "num_heads": 8, | ||
| "emb_dropout": 0.1, | ||
| "attn_dropout": 0.1, | ||
| "block_output_dropout": 0.1, | ||
| "sinusoidal_embedding": false, | ||
| "activation": "gelu", | ||
| "supervise_all_steps": false, | ||
| "nn_parameter_for_timesteps": true, | ||
| "pred_future_acs": false | ||
| } | ||
| }, | ||
| "observation": { | ||
| "modalities": { | ||
| "obs": { | ||
| "low_dim": [ | ||
| "eef_pos", | ||
| "eef_quat", | ||
| "gripper_pos", | ||
| "object_position", | ||
| "target_object_position", | ||
| "joint_pos", | ||
| "joint_vel", | ||
| "actions" | ||
| ], | ||
| "rgb": [], | ||
| "depth": [], | ||
| "scan": [] | ||
| }, | ||
| "goal": { | ||
| "low_dim": [], | ||
| "rgb": [], | ||
| "depth": [], | ||
| "scan": [] | ||
| } | ||
| }, | ||
| "encoder": { | ||
| "low_dim": { | ||
| "core_class": null, | ||
| "core_kwargs": {}, | ||
| "obs_randomizer_class": null, | ||
| "obs_randomizer_kwargs": {} | ||
| }, | ||
| "rgb": { | ||
| "core_class": "VisualCore", | ||
| "core_kwargs": {}, | ||
| "obs_randomizer_class": null, | ||
| "obs_randomizer_kwargs": {} | ||
| }, | ||
| "depth": { | ||
| "core_class": "VisualCore", | ||
| "core_kwargs": {}, | ||
| "obs_randomizer_class": null, | ||
| "obs_randomizer_kwargs": {} | ||
| }, | ||
| "scan": { | ||
| "core_class": "ScanCore", | ||
| "core_kwargs": {}, | ||
| "obs_randomizer_class": null, | ||
| "obs_randomizer_kwargs": {} | ||
| } | ||
| } | ||
| }, | ||
| "meta": { | ||
| "hp_base_config_file": null, | ||
| "hp_keys": [], | ||
| "hp_values": [] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,29 +2,15 @@ | |
|
|
||
| ## script to run experiments in the background | ||
|
|
||
| task="Dev-IK-Rel-v1" | ||
| horizon=500 | ||
| task="Dev-IK-Rel-Insert-v0" | ||
| horizon=1000 | ||
| num_rollouts=100 | ||
| run_file="scripts/imitation_learning/robomimic/play_ensemble_v05.py" | ||
| exp_type="lift_none" | ||
| exp_type="insert_low_calib" | ||
|
|
||
| ##### this now runs the experiments | ||
|
|
||
| # ## ensemble 15 | ||
| # ensemble_size=15 | ||
| # seed=101 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| # seed=107 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| # seed=115 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| ## ensemble 10 | ||
| # # ## ensemble 15 | ||
| ensemble_size=10 | ||
| seed=101 | ||
| exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
|
|
@@ -38,16 +24,30 @@ seed=115 | |
| exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| ## ensemble 5 | ||
| ensemble_size=5 | ||
| seed=101 | ||
| exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
| # # ## ensemble 10 | ||
| # ensemble_size=10 | ||
| # seed=101 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| seed=107 | ||
| exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
| # seed=107 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| seed=115 | ||
| exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
| # seed=115 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| # ## ensemble 5 | ||
| # ensemble_size=5 | ||
| # seed=101 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| # seed=107 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
|
||
| # seed=115 | ||
| # exp_name="${task}_ensemble_${ensemble_size}_seed_${seed}_${exp_type}" | ||
| # ./isaaclab.sh -p $run_file --task $task --horizon $horizon --num_rollouts $num_rollouts --ensemble_size $ensemble_size --seed $seed --exp_name $exp_name --headless | ||
|
Comment on lines
+27
to
+53
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |||||
| from backup_controller import BackupControllerSM | ||||||
| from backup_controller_place import BackupControllerPlaceSM | ||||||
| from backup_controller_insert import BackupControllerInsertSM | ||||||
| from backup_controller_insert_top import BackupControllerInsertSM | ||||||
|
Comment on lines
8
to
+9
|
||||||
| import torch | ||||||
|
|
||||||
|
|
||||||
|
|
@@ -41,7 +42,10 @@ def _get_controller(self): | |||||
| print(f"[DEBUG] Using Place Backup Controller") | ||||||
| return BackupControllerPlaceSM(dt=0.01*2, num_envs=self.num_envs, position_threshold=0.02, device='cuda', offset = torch.tensor([[-0.1, 0, 0.1]], device='cuda:0'), goal_quat = self.object_goal_rot, goal_pos= self.object_goal_pos) | ||||||
| case "insert": | ||||||
| return BackupControllerInsertSM(0.01*2, self.num_envs,'cuda' , 0.02) | ||||||
| return BackupControllerInsertSM(dt=0.01*2, num_envs=self.num_envs, position_threshold=0.02, device='cuda', offset = torch.tensor([[-0.1, 0, 0.1]], device='cuda:0'), goal_quat = self.object_goal_rot, goal_pos= self.object_goal_pos) | ||||||
| case "insert_top": | ||||||
| ### check this quat | ||||||
| return BackupControllerInsertSM(dt=0.01*2, num_envs=self.num_envs, position_threshold=0.02, device='cuda', offset = torch.tensor([[-0.1, 0, 0.1]], device='cuda:0'), goal_quat = self.object_goal_rot, goal_pos= self.object_goal_pos) | ||||||
| case _: | ||||||
| raise ValueError(f"Unknown task type {self.tasktype} for backup controller") | ||||||
|
|
||||||
|
|
@@ -55,7 +59,9 @@ def _get_goal_pos(self): | |||||
| goal_pos = self.env.unwrapped.scene["scale"].data.root_pose_w | ||||||
| # print(f"[DEBUG] Getting goal pos for place task {goal_pos}") | ||||||
| return self.env.unwrapped.scene["scale"].data.root_pose_w | ||||||
|
|
||||||
| case "insert_top": | ||||||
| # still vial rack | ||||||
| return self.env.unwrapped.scene["vialrack"].data.root_pose_w | ||||||
| case "insert": | ||||||
| return self.env.unwrapped.scene["vialrack"].data.root_pose_w | ||||||
|
|
||||||
|
|
@@ -69,9 +75,12 @@ def _get_goal_rot(self): | |||||
| goal_rot = self.env.unwrapped.command_manager.get_command("object_pose") | ||||||
| print(f"[DEBUG] Getting goal quat for place task {goal_rot}") | ||||||
| return self.env.unwrapped.command_manager.get_command("object_pose") | ||||||
|
|
||||||
| case "insert_top": | ||||||
| goal_rot = torch.tensor([[0,1,0,0]], device=self.device)#self.env.unwrapped.command_manager.get_command("object_pose") | ||||||
| return goal_rot #self.env.unwrapped.command_manager.get_command("object_pose") | ||||||
| case "insert": | ||||||
| return self.env.unwrapped.scene["vialrack"].data.root_pose_w | ||||||
| goal_rot = self.env.unwrapped.command_manager.get_command("object_pose") | ||||||
| return self.env.unwrapped.command_manager.get_command("object_pose") | ||||||
|
|
||||||
| def reset(self): | ||||||
| self.backup_controller.reset_idx() | ||||||
|
|
@@ -89,9 +98,15 @@ def _get_rest_pos(self): | |||||
| # lets change this into the 6 element tensor they are expecting | ||||||
| roll,pitch,yaw = euler_xyz_from_quat(ee_recovery_rot) | ||||||
| rest_pos = torch.cat([rest_pos, ee_recovery_rot], dim =-1) | ||||||
|
|
||||||
| #print(f"rpy version :{torch.cat([rest_pos,roll.unsqueeze(0), pitch.unsqueeze(0), yaw.unsqueeze(0)], dim =-1)}") | ||||||
| if self.tasktype == "insert_top": | ||||||
| rest_pos = torch.tensor([[ 0.6226, -0.0621, 0.3555]], device=self.device) | ||||||
| rest_rot = tensor([[ 0, 1, 0, 0]], device=self.device) | ||||||
|
||||||
| rest_rot = tensor([[ 0, 1, 0, 0]], device=self.device) | |
| rest_rot = torch.tensor([[ 0, 1, 0, 0]], device=self.device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded absolute Docker path reduces portability. Consider using relative paths or making this configurable to work in different environments.