From b57dabaa88fde690975392be8ba13902f0f7c19c Mon Sep 17 00:00:00 2001 From: Ben Eisner Date: Tue, 28 May 2024 22:30:05 -0400 Subject: [PATCH] more debugging, new checkpoints --- pyproject.toml | 2 +- scripts/eval_metrics.py | 46 +++++++++++++++++++++++++++++++ scripts/eval_rlbench.py | 2 ++ scripts/run_rlbench10_rollouts.sh | 20 +++++++------- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 99ff721..2047d37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ rlbench = [ # These should be installed manually... # "pyrep", # "rlbench @ git+https://github.com/stepjam/RLBench.git", - "rpad-rlbench-utils @ git+https://github.com/r-pad/rlbench_utils.git@5d6167cbb07c25242e3a87a5d5a896c05a7370a7", + "rpad-rlbench-utils @ git+https://github.com/r-pad/rlbench_utils.git@66f854735991f724f88777cd0c0de3e457a24739", ] diff --git a/scripts/eval_metrics.py b/scripts/eval_metrics.py index 5c86b94..1842246 100644 --- a/scripts/eval_metrics.py +++ b/scripts/eval_metrics.py @@ -223,6 +223,52 @@ def main(cfg): } ) + fig = segmentation_fig( + torch.cat( + [ + points_action[0].cpu(), + points_anchor[0].cpu(), + ], + dim=0, + ).numpy(), + torch.cat( + [ + torch.ones(points_action.shape[1]), + 2 * torch.ones(points_anchor.shape[1]), + ], + dim=0, + ) + .int() + .numpy(), + labelmap={1: "demo_action", 2: "demo_anchor"}, + ) + fig.show() + + # Prediction. + fig = segmentation_fig( + torch.cat( + [ + points_action_trans[0].cpu(), + points_anchor_trans[0].cpu(), + res["pred_points_action"][0].cpu(), + ], + dim=0, + ).numpy(), + torch.cat( + [ + torch.ones(points_action_trans.shape[1]), + 2 * torch.ones(points_anchor_trans.shape[1]), + 3 * torch.ones(res["pred_points_action"].shape[1]), + ], + dim=0, + ) + .int() + .numpy(), + labelmap={1: "action", 2: "anchor", 3: "pred"}, + ) + fig.show() + breakpoint() + metrics = { k: np.concatenate([m[k] for m in metrics]) for k in metrics[0].keys() } diff --git a/scripts/eval_rlbench.py b/scripts/eval_rlbench.py index aa41227..cd27ae0 100644 --- a/scripts/eval_rlbench.py +++ b/scripts/eval_rlbench.py @@ -404,6 +404,7 @@ def predict(self, obs, phase: str) -> Tuple[np.ndarray, Dict[str, Any]]: phase_onehot = np.zeros(len(TASK_DICT[self.task_name]["phase_order"])) phase_onehot[phase_ix] = 1 phase_onehot = torch.from_numpy(phase_onehot).to(device)[None] + logging.info(f"Phase Onehot: {phase_onehot}") else: phase_onehot = None @@ -783,6 +784,7 @@ def pr(): # Loop through the phases, and predict. phase_plots: List[go.Figure] = [] for phase in phase_order: + logging.info(f"Executing Phase: {phase}") N_MOTION_PLANNING_SAMPLING_TRIES = 20 motion_succeeded = False # whether any of the predicted motions succeeded. diff --git a/scripts/run_rlbench10_rollouts.sh b/scripts/run_rlbench10_rollouts.sh index 471a06c..10e3d9a 100755 --- a/scripts/run_rlbench10_rollouts.sh +++ b/scripts/run_rlbench10_rollouts.sh @@ -46,24 +46,24 @@ ########################### No gripper, wrist cam ############################# -# pick_and_lift: hbdcvydg -# pick_up_cup: gwfjqpfk +# pick_and_lift: 8pyp8zaw +# pick_up_cup: 9m4fflcx # push_button: mmc5fhzu # put_knife_on_chopping_board: rjscih24 -# put_money_in_safe: gj3h3o3c -# reach_target: v8vv53tx +# put_money_in_safe: tpuvxzyg +# reach_target: ffp30alr # slide_block_to_target: sejd7pz0 # stack_wine: 3hyo3r7q -# take_money_out_safe: 69gka1ew +# take_money_out_safe: u4bpi2bf # take_umbrella_out_of_umbrella_stand: b48mz8e1 # pick_and_lift -./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/pick_and_lift/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-hbdcvydg:v0 wandb.group=rlbench_pick_and_lift +./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/pick_and_lift/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-8pyp8zaw:v0 wandb.group=rlbench_pick_and_lift # pick_up_cup -./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/pick_up_cup/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-gwfjqpfk:v0 wandb.group=rlbench_pick_up_cup +./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/pick_up_cup/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-9m4fflcx:v0 wandb.group=rlbench_pick_up_cup # put_knife_on_chopping_board @@ -71,7 +71,7 @@ # put_money_in_safe -./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/put_money_in_safe/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-gj3h3o3c:v0 wandb.group=rlbench_put_money_in_safe +./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/put_money_in_safe/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-tpuvxzyg:v0 wandb.group=rlbench_put_money_in_safe # push_button @@ -79,7 +79,7 @@ # reach_target -./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/reach_target/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-v8vv53tx:v0 wandb.group=rlbench_reach_target +./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/reach_target/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-ffp30alr:v0 wandb.group=rlbench_reach_target # slide_block_to_target @@ -91,7 +91,7 @@ # take_money_out_safe -./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/take_money_out_safe/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-69gka1ew:v0 wandb.group=rlbench_take_money_out_safe +./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/take_money_out_safe/taxpose_tc/eval_rlbench.yaml num_trials=100 policy_spec.include_rgb_features=True model.feature_channels=3 checkpoints.ckpt_file=r-pad/taxpose/model-u4bpi2bf:v0 wandb.group=rlbench_take_money_out_safe # take_umbrella_out_of_umbrella_stand