opendilab / LightZero

[NeurIPS 2023 Spotlight] LightZero: A Unified Benchmark for Monte Carlo Tree Search in General Sequential Decision Scenarios (awesome MCTS)
https://huggingface.co/spaces/OpenDILabCommunity/ZeroPal
Apache License 2.0
1.15k stars 120 forks source link

如果想渲染环境如何设置? #287

Closed ldepn closed 1 month ago

ldepn commented 1 month ago

以cartpole为例,在训练时,如果想渲染环境如何设置?

puyuan1996 commented 1 month ago

您好,当您运行这个脚本并得到收敛结果后,best ckpt文件会保存在类似以下路径的文件夹中:

./LightZero/zoo/classic_control/cartpole/config/data_muzero/cartpole_muzero_ns25_upc100_rer0_seed0/ckpt/ckpt_best.pth.tar

接下来,您只需在这里将路径修改为您保存的 best ckpt 文件的实际路径,然后运行这个脚本。运行完成后,您可以在以下路径找到模型与环境交互生成的 GIF 回放:

./LightZero/zoo/classic_control/cartpole/entry/cartpole_gif

类似这样: CartPole-v0_episode_0_20241016155515

如果您有任何问题,欢迎随时提问。