Title
deploy_policy.py: current_state_norm is computed from stat.json but never used in inference
Summary
In the RoboTwin evaluation pipeline, deploy_policy.py computes a normalized version of the 14-dim current_state using stat.json, but this normalized state does not seem to be used anywhere in the actual inference path. As a result, stat.json appears to have no effect on the qpos evaluation behavior.
I would like to confirm whether this is intentional, or whether some normalization / denormalization logic is missing.
Location
Relevant code:
inference/robotwin/Motus/deploy_policy.py
- around
update_obs() and get_action()
What I observed
In update_obs(), the code loads the robot state from:
state = observation['joint_action']['vector']
Then it stores:
self.current_state = state_tensor.to(self.device)
self.current_state_norm = self._normalize_actions(self.current_state).to(self.device)
So current_state_norm is indeed computed from the min/max statistics in utils/stat.json. [code]
However, in get_action(), the actual model call uses:
predicted_frames, predicted_actions = self.model.inference_step(
first_frame=current_frame,
state=self.current_state,
...
)
instead of self.current_state_norm. Also, after inference, predicted_actions are returned directly, without any call to _denormalize_actions().
Why this is confusing
From reading the code, the intended workflow seems to be:
- load normalization statistics from
stat.json
- normalize the 14-dim qpos state
- feed normalized state into the model
- possibly denormalize the output actions before execution
But the current implementation appears to do:
- load normalization statistics from
stat.json
- compute
self.current_state_norm
- never use it
- run inference with
self.current_state
- execute predicted actions directly with
action_type='qpos'
So it is unclear whether:
stat.json is just legacy / unused code,
- the model was intentionally trained on raw qpos states,
- or the normalized state should actually be passed into
inference_step().
Question
Could you clarify which of the following is correct?
stat.json is currently unused in RoboTwin evaluation and can be ignored.
current_state_norm should be used in inference_step(), and this is a bug.
- The model expects raw
current_state, but the normalization code was kept from an earlier implementation.
- Output actions are expected to be normalized / denormalized somewhere else, and I missed that part.
Additional context
I am trying to adapt this evaluation code from qpos mode to end-effector mode, so understanding whether stat.json is semantically important here would be very helpful. Right now it looks like the actual qpos behavior is determined mainly by:
state = observation['joint_action']['vector']
...
state=self.current_state
...
TASK_ENV.take_action(action, action_type='qpos')
rather than by stat.json itself.
Thanks!
Title
deploy_policy.py:current_state_normis computed fromstat.jsonbut never used in inferenceSummary
In the RoboTwin evaluation pipeline,
deploy_policy.pycomputes a normalized version of the 14-dimcurrent_stateusingstat.json, but this normalized state does not seem to be used anywhere in the actual inference path. As a result,stat.jsonappears to have no effect on the qpos evaluation behavior.I would like to confirm whether this is intentional, or whether some normalization / denormalization logic is missing.
Location
Relevant code:
inference/robotwin/Motus/deploy_policy.pyupdate_obs()andget_action()What I observed
In
update_obs(), the code loads the robot state from:Then it stores:
So
current_state_normis indeed computed from the min/max statistics inutils/stat.json. [code]However, in
get_action(), the actual model call uses:instead of
self.current_state_norm. Also, after inference,predicted_actionsare returned directly, without any call to_denormalize_actions().Why this is confusing
From reading the code, the intended workflow seems to be:
stat.jsonBut the current implementation appears to do:
stat.jsonself.current_state_normself.current_stateaction_type='qpos'So it is unclear whether:
stat.jsonis just legacy / unused code,inference_step().Question
Could you clarify which of the following is correct?
stat.jsonis currently unused in RoboTwin evaluation and can be ignored.current_state_normshould be used ininference_step(), and this is a bug.current_state, but the normalization code was kept from an earlier implementation.Additional context
I am trying to adapt this evaluation code from qpos mode to end-effector mode, so understanding whether
stat.jsonis semantically important here would be very helpful. Right now it looks like the actual qpos behavior is determined mainly by:rather than by
stat.jsonitself.Thanks!