计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
envs-and-vectorization【效率与协作】Integrate Gymnasium and PettingZoo environments with Tianshou vector envs, workers, wrappers, space introspection, seeding, and optional environment backends.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when work mentions DummyVectorEnv, SubprocVectorEnv, ShmemVectorEnv, RayVectorEnv, PettingZooEnv, action masks, custom Gymnasium environments, vectorized rollouts, environment workers, wrappers, seeding, or optional engines such as EnvPool, MuJoCo, Atari, VizDoom, Box2D, or robotics.
../procedural-training/SKILL.md after the environment interface is valid.EnvFactoryRegistered setup, use ../highlevel-experiments/SKILL.md; this sub-skill only covers lower-level env factories and vector env behavior.../offline-and-specialized-rl/SKILL.md after confirming the environment observation/action contract.lambda: gym.make("CartPole-v1"); never pass already-created env instances into Tianshou vector env constructors.DummyVectorEnv(env_fns) for API validation, deterministic debugging, custom wrappers, and smoke checks.SubprocVectorEnv(env_fns, context="spawn" or "fork") or ShmemVectorEnv(env_fns) only after the factories are picklable/importable and observations are compatible with batching.RayVectorEnv(env_fns) only when ray is installed and distributed execution is actually needed.reset() before stepping, pass one action per selected env id, reset done env ids yourself after terminated | truncated, and always call close().PettingZooEnv; expect observations shaped as dictionaries containing obs, agent_id, and usually mask for discrete legal actions.references/api-reference.md lists constructors, vector env methods, worker behavior, wrappers, PettingZooEnv, and SpaceInfo.references/workflows.md gives custom env, vectorization, seeding, PettingZoo/action-mask, and optional-backend workflows.references/troubleshooting.md maps common install/import, optional dependency, validation, CLI/API misuse, and workflow failures to fixes.scripts/check_vector_env.py is a tiny CartPole smoke check that validates Tianshou vector env calls without training.Run the bundled helper from the generated skill tree after installing public Tianshou dependencies:
python skills/tianshou/sub-skills/envs-and-vectorization/scripts/check_vector_env.py --num-envs 2 --steps 4
Add --subproc only after the default dummy run passes; subprocess mode is intentionally conservative and uses a top-level factory to avoid common pickling pitfalls.