mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-24 21:19:53 +00:00
fix(rl): postprocess action in actor
This commit is contained in:
@@ -261,7 +261,7 @@ def act_with_policy(
|
|||||||
policy = policy.eval()
|
policy = policy.eval()
|
||||||
assert isinstance(policy, nn.Module)
|
assert isinstance(policy, nn.Module)
|
||||||
|
|
||||||
preprocessor, _postprocessor = make_pre_post_processors(
|
preprocessor, postprocessor = make_pre_post_processors(
|
||||||
policy_cfg=cfg.policy,
|
policy_cfg=cfg.policy,
|
||||||
dataset_stats=cfg.policy.dataset_stats,
|
dataset_stats=cfg.policy.dataset_stats,
|
||||||
)
|
)
|
||||||
@@ -292,6 +292,7 @@ def act_with_policy(
|
|||||||
with policy_timer:
|
with policy_timer:
|
||||||
normalized_observation = preprocessor.process_observation(observation)
|
normalized_observation = preprocessor.process_observation(observation)
|
||||||
action = policy.select_action(batch=normalized_observation)
|
action = policy.select_action(batch=normalized_observation)
|
||||||
|
action = postprocessor.process_action(action)
|
||||||
policy_fps = policy_timer.fps_last
|
policy_fps = policy_timer.fps_last
|
||||||
|
|
||||||
log_policy_frequency_issue(policy_fps=policy_fps, cfg=cfg, interaction_step=interaction_step)
|
log_policy_frequency_issue(policy_fps=policy_fps, cfg=cfg, interaction_step=interaction_step)
|
||||||
|
|||||||
Reference in New Issue
Block a user