dreamerv2
Use DreamerV2 2.2.0 for TensorFlow world-model reinforcement-learning training, custom Gym integration, typed experiment configuration, replay/checkpoint management, and JSONL/TensorBoard evaluation.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- dreamerv2
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use DreamerV2 2.2.0 for TensorFlow world-model reinforcement-learning training, custom Gym integration, typed experiment configuration, replay/checkpoint management, and JSONL/TensorBoard evaluation.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md1.6 KB
- 参考文档references/repo-routing-metadata.json436 B
- 参考文档references/troubleshooting.md4.9 KB
- 脚本scripts/check_install.py1.4 KB
03 SKILL.md 正文
DreamerV2
Use this skill for the danijar/dreamerv2 2.2.0 package: discrete world-model
reinforcement learning with TensorFlow, native Atari/DM Control/Crafter runners,
custom legacy Gym environments, typed configuration, replay/checkpoints, and
experiment plots. Treat this as a TensorFlow 2.6-era package, not a current
Gymnasium or modern-Keras package.
Route the task
- Launch, bound, resume, or diagnose a run: read training.
- Adapt an environment or validate observations/actions: read environments.
- Compose presets, flags, schedules, or serialized configs: read configuration.
- Inspect metrics, TensorBoard artifacts, or compare runs: read evaluation.
Read only the route needed for the request, then follow its linked references. The sub-skills are one operating graph: a training request commonly visits configuration first, environments for the data contract, and evaluation after artifacts exist.
Install a compatible runtime
The verified package facts are distribution dreamerv2==2.2.0, import modules
dreamerv2 and dreamerv2.api, and console entry point dreamerv2. This source
release uses tensorflow.keras.mixed_precision.experimental and the legacy Gym
API. Prefer a fresh Python 3.9 environment with a coherent era stack:
python -m pip install \
'tensorflow==2.6.0' 'tensorflow-probability==0.14.1' \
'gym==0.23.1' 'ruamel.yaml<0.18' \
'numpy==1.19.5' 'pillow<10' 'pandas<2' 'matplotlib<3.8'
python -m pip install --no-deps 'dreamerv2==2.2.0'
Add only the suites you will use: atari_py plus imported Atari ROMs for
Atari, a compatible dm_control/MuJoCo/EGL setup for DMC, crafter for
Crafter, and the environment's own package for custom Gym. Do not download
ROMs, MuJoCo assets, or credentials as an unattended smoke check. Read
troubleshooting before mixing newer TensorFlow,
TensorFlow Probability, Gym/Gymnasium, or NumPy versions.
Check the installation without starting training:
python -m pip check
python - <<'PY'
import inspect
import tensorflow as tf
import dreamerv2.api as dv2
print('TensorFlow', tf.__version__)
print('GPUs', tf.config.list_physical_devices('GPU'))
print('api.train', inspect.signature(dv2.train))
print('default task', dv2.defaults.task)
PY
python -m dreamerv2.train --help
The module help route is verified. Do not use the installed dreamerv2
launcher in this release: train.py derives configs.yaml from
sys.argv[0], so the launcher may search beside its bin script and fail with a
missing-config error. Use python -m dreamerv2.train instead. The plotting
route is available through the evaluation sub-skill's bundled adapter.
Operating rules
- Native
python -m dreamerv2.trainasserts that TensorFlow sees a GPU; a CPU import ordebugpreset does not make native training CPU-safe. - Use a new writable
logdirper run. The effectiveconfig.yaml, replay episodes,metrics.jsonl, TensorBoard events, andvariables.pklare the observable outputs; a checkpoint alone is not a successful experiment. - Validate one environment reset/step and its action/observation contract
before allocating training. Keep
--envs_parallel nonefor this snapshot unless the asynchronous branch has been patched and tested. - Make
debugthe last preset, set a bounded--steps, and explicitly choose--precision 32when the legacy mixed-precision path is not verified. - Preserve exact package/runtime versions and effective config with results. For refresh decisions, read repository provenance.
Scope and limits
This graph distills public package behavior and safe operational recipes. It does not run benchmark-scale training, fetch external assets, import the skill into the managed repo library, or claim that a modern unpinned dependency set is compatible. Use cross-cutting troubleshooting for install/import, backend, dependency, and source-version failures before escalating to the focused route.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).