Skip to content

Fix env checks for async environments #1711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

atyshka
Copy link

@atyshka atyshka commented Aug 11, 2025

What this does

Async environments have been broken ever since OpenPi added new checks to the environments in #921. This refactors the checks where possible, but I could not find a way to implement the type check for async envs, so this check is skipped with a warning.

How it was tested

I trained smolvla with the aloha sim environment.

How to checkout & try? (for the reviewer)

lerobot-train \
    --policy.type=act \
    --dataset.repo_id=lerobot/aloha_sim_insertion_human \
    --env.type=aloha \
    --output_dir=outputs/train/act_aloha_insertion
    --env.use_async_envs=true

@Copilot Copilot AI review requested due to automatic review settings August 11, 2025 20:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes environment checks for async environments by refactoring the way environment attributes are accessed and validated. The changes address issues where async environments were broken due to new environment checks that didn't work with the async vector environment pattern.

Key changes:

  • Replaces direct attribute access on env.envs[0] with safer env.call() method calls
  • Adds exception handling for environment method calls to gracefully handle missing attributes
  • Skips type checking for AsyncVectorEnv with a warning since it cannot be reliably implemented

@AdilZouitine AdilZouitine added bug Something isn’t working correctly simulation Matters involving system simulation or modeling labels Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working correctly simulation Matters involving system simulation or modeling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants