framework 默认使用 tf1
# tf: TensorFlow (static-graph)
# tf2: TensorFlow 2.x (eager)
# tfe: TensorFlow eager
# torch: PyTorch
--config='{"framework": "tf"}'
--config='{"framework": "tf2"}'
# Enable tracing in eager mode. This greatly improves performance, but
# makes it slightly harder to debug since Python code won't be evaluated
# after the initial eager pass. Only possible if framework=tfe.
--config='{"framework": "tf2", "eager_tracing": true}'
--config='{"framework": "tfe"/"tf2"}'
--config='{"framework": "torch"}'
--torch
tf 测试命令
rllib train --run PPO --env PongDeterministic-v4 --checkpoint-freq 100 \
--config '{"num_workers": 8, "num_gpus": 1}'
pytorch 测试命令
rllib train --run PPO --env PongDeterministic-v4 --checkpoint-freq 100 \
--config '{"framework": "torch", "num_workers": 8, "num_gpus": 1}'
tensorboard 可视化
tensorboard --logdir=~/ray_results --port 80
模型评估
rllib rollout \
~/ray_results/default/PPO_PongDeterministic-v4_0upjmdgr0/checkpoint_1/checkpoint-1 \
--run PPO --env PongDeterministic-v4 --steps 10000