mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 02:59:50 +00:00
fix(train): eval env initialization on train script (#2818)
* fix: eval env initialization on train script Signed-off-by: bigmbigk <bigmbigk@gmail.com> * fix: eval env creation condition --------- Signed-off-by: bigmbigk <bigmbigk@gmail.com>
This commit is contained in:
@@ -225,9 +225,8 @@ def train(cfg: TrainPipelineConfig, accelerator: Accelerator | None = None):
|
|||||||
# On real-world data, no need to create an environment as evaluations are done outside train.py,
|
# On real-world data, no need to create an environment as evaluations are done outside train.py,
|
||||||
# using the eval.py instead, with gym_dora environment and dora-rs.
|
# using the eval.py instead, with gym_dora environment and dora-rs.
|
||||||
eval_env = None
|
eval_env = None
|
||||||
if cfg.eval_freq > 0 and cfg.env is not None:
|
if cfg.eval_freq > 0 and cfg.env is not None and is_main_process:
|
||||||
if is_main_process:
|
logging.info("Creating env")
|
||||||
logging.info("Creating env")
|
|
||||||
eval_env = make_env(cfg.env, n_envs=cfg.eval.batch_size, use_async_envs=cfg.eval.use_async_envs)
|
eval_env = make_env(cfg.env, n_envs=cfg.eval.batch_size, use_async_envs=cfg.eval.use_async_envs)
|
||||||
|
|
||||||
if is_main_process:
|
if is_main_process:
|
||||||
|
|||||||
Reference in New Issue
Block a user