fix(vlabench): re-install lerobot editably + coerce agent_pos shape

- The nightly base image has stale lerobot code (pre-dates VLABenchEnv
  addition), so COPY . . doesn't propagate into .venv. Run
  `uv pip install --no-deps -e .` after COPY, same fix as robocasa365.
- Coerce ee_state to exactly shape (7,) so SyncVectorEnv.concatenate
  doesn't raise "Output array is the wrong shape" when VLABench's
  actual ee_state length differs from our declared observation_space.

Made-with: Cursor
This commit is contained in:
Pepijn
2026-04-16 21:36:18 +02:00
parent da7fb54c64
commit 63dbdf0e55
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -50,4 +50,8 @@ RUN python ~/VLABench/scripts/download_assets.py --choice all
# Overlay the PR's source code on top of the nightly image. # Overlay the PR's source code on top of the nightly image.
COPY --chown=user_lerobot:user_lerobot . . COPY --chown=user_lerobot:user_lerobot . .
# Re-install lerobot editably so the new source (with VLABenchEnv registration
# and updated obs handling) replaces the stale package baked into the nightly image.
RUN uv pip install --no-cache --no-deps -e .
CMD ["/bin/bash"] CMD ["/bin/bash"]
+7 -1
View File
@@ -248,8 +248,14 @@ class VLABenchEnv(gym.Env):
images[key] = cv2.resize(images[key], (w, h), interpolation=cv2.INTER_AREA).astype(np.uint8) images[key] = cv2.resize(images[key], (w, h), interpolation=cv2.INTER_AREA).astype(np.uint8)
# Extract end-effector state # Extract end-effector state — coerce to exactly (7,) so vector env concat
# doesn't fail with shape-mismatch on buffer np.stack.
ee_state = obs.get("ee_state", np.zeros(7, dtype=np.float64)) ee_state = obs.get("ee_state", np.zeros(7, dtype=np.float64))
ee_state = np.asarray(ee_state, dtype=np.float64).ravel()
if ee_state.shape[0] != 7:
fixed = np.zeros(7, dtype=np.float64)
fixed[: min(7, ee_state.shape[0])] = ee_state[:7]
ee_state = fixed
if self.obs_type == "pixels": if self.obs_type == "pixels":
return {"pixels": images} return {"pixels": images}