mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
[RLlib] Issue 15724: Breaking example script in docs due to outdated eager
config flag (use framework='tf2|tfe' instead). (#15736)
This commit is contained in:
parent
4c8813f2e8
commit
4e9555cad3
4 changed files with 7 additions and 7 deletions
|
@ -423,8 +423,8 @@ Building Policies in TensorFlow Eager
|
||||||
|
|
||||||
Policies built with ``build_tf_policy`` (most of the reference algorithms are)
|
Policies built with ``build_tf_policy`` (most of the reference algorithms are)
|
||||||
can be run in eager mode by setting
|
can be run in eager mode by setting
|
||||||
the ``"eager": True`` / ``"eager_tracing": True`` config options or
|
the ``"framework": "tf2"`` / ``"eager_tracing": True`` config options or
|
||||||
using ``rllib train --eager [--trace]``.
|
using ``rllib train '{"framework": "tf2", "eager_tracing": True}'``.
|
||||||
This will tell RLlib to execute the model forward pass, action distribution,
|
This will tell RLlib to execute the model forward pass, action distribution,
|
||||||
loss, and stats functions in eager mode.
|
loss, and stats functions in eager mode.
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ references in the cluster.
|
||||||
TensorFlow 2.0
|
TensorFlow 2.0
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
RLlib currently runs in ``tf.compat.v1`` mode. This means eager execution is disabled by default, and RLlib imports TF with ``import tensorflow.compat.v1 as tf; tf.disable_v2_behaviour()``. Eager execution can be enabled manually by calling ``tf.enable_eager_execution()`` or setting the ``"eager": True`` trainer config.
|
RLlib currently runs in ``tf.compat.v1`` mode. This means eager execution is disabled by default, and RLlib imports TF with ``import tensorflow.compat.v1 as tf; tf.disable_v2_behaviour()``. Eager execution can be enabled manually by calling ``tf.enable_eager_execution()`` or setting the ``"framework": "tf2"`` trainer config.
|
||||||
|
|
||||||
.. |tensorflow| image:: tensorflow.png
|
.. |tensorflow| image:: tensorflow.png
|
||||||
:class: inline-figure
|
:class: inline-figure
|
||||||
|
|
|
@ -14,7 +14,7 @@ You can train a simple DQN trainer with the following command:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
rllib train --run DQN --env CartPole-v0 # --eager [--trace] for eager execution
|
rllib train --run DQN --env CartPole-v0 # --config '{"framework": "tf2", "eager_tracing": True}' for eager execution
|
||||||
|
|
||||||
By default, the results will be logged to a subdirectory of ``~/ray_results``.
|
By default, the results will be logged to a subdirectory of ``~/ray_results``.
|
||||||
This subdirectory will contain a file ``params.json`` which contains the
|
This subdirectory will contain a file ``params.json`` which contains the
|
||||||
|
@ -906,7 +906,7 @@ Eager Mode
|
||||||
Policies built with ``build_tf_policy`` (most of the reference algorithms are)
|
Policies built with ``build_tf_policy`` (most of the reference algorithms are)
|
||||||
can be run in eager mode by setting the
|
can be run in eager mode by setting the
|
||||||
``"framework": "[tf2|tfe]"`` / ``"eager_tracing": True`` config options or using
|
``"framework": "[tf2|tfe]"`` / ``"eager_tracing": True`` config options or using
|
||||||
``rllib train --eager [--trace]``.
|
``rllib train --config '{"framework": "tf2"}' [--trace]``.
|
||||||
This will tell RLlib to execute the model forward pass, action distribution,
|
This will tell RLlib to execute the model forward pass, action distribution,
|
||||||
loss, and stats functions in eager mode.
|
loss, and stats functions in eager mode.
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ Then, you can try out training in the following equivalent ways:
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
rllib train --run=PPO --env=CartPole-v0 # -v [-vv] for verbose,
|
rllib train --run=PPO --env=CartPole-v0 # -v [-vv] for verbose,
|
||||||
# --eager [--trace] for eager execution,
|
# --config='{"framework": "tf2", "eager_tracing": True}' for eager,
|
||||||
# --torch to use PyTorch
|
# --torch to use PyTorch OR --config='{"framework": "torch"}'
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue