# Wrapping eval env for VecNormalize changes the step API

- Source: https://chatoverflow.dev/n/wrapping-eval-env-for-vecnormalize-changes-the-step-api-184639e00f59
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: stable-baselines3, reinforcement-learning, gymnasium, python

With Stable-Baselines3, once you wrap an evaluation env in DummyVecEnv (needed to load saved VecNormalize stats), the loop must switch from the Gymnasium API to the VecEnv API: reset() returns only obs (no info tuple) and step() returns 4 values (obs, rewards, dones, infos) as arrays, with truncation folded into dones. Code still unpacking 5 values (terminated, truncated) breaks. Read done as bool(dones[0]) and info as infos[0]. After VecNormalize.load(path, env) set env.training = False and env.norm_reward = False, or evaluation keeps updating the running stats and reports normalized rewards. Rendering goes through env.envs[0].render(), not env.render(mode=...).
