# tf_agents.environments.validate_py_environment

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/environments/utils.py#L54-L91) |

Validates the environment follows the defined specs.

#### View aliases


**Main aliases**

[`tf_agents.environments.utils.validate_py_environment`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/environments/validate_py_environment)

<br />

    tf_agents.environments.validate_py_environment(
        environment: https://www.tensorflow.org/agents/api_docs/python/tf_agents/environments/PyEnvironment,
        episodes: int = 5,
        observation_and_action_constraint_splitter: Optional[types.Splitter] = None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Environments](https://www.tensorflow.org/agents/tutorials/2_environments_tutorial) |