Skip to content

Commit

Permalink
more debugging, new checkpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
beneisner committed May 29, 2024
1 parent d702053 commit b57daba
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]


Expand Down
46 changes: 46 additions & 0 deletions scripts/eval_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 2 additions & 0 deletions scripts/eval_rlbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down
20 changes: 10 additions & 10 deletions scripts/run_rlbench10_rollouts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,40 +46,40 @@

########################### 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

./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/put_knife_on_chopping_board/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-rjscih24:v0 wandb.group=rlbench_put_knife_on_chopping_board

# 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

./launch.sh local-docker 0 python scripts/eval_rlbench.py --config-name commands/rlbench/push_button/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-mmc5fhzu:v0 wandb.group=rlbench_push_button

# 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

Expand All @@ -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

Expand Down

0 comments on commit b57daba

Please sign in to comment.