Python 在rllib中注册健身房环境时传递可选参数
我一直在遵循这个有用的示例在健身房创建一个自定义环境,然后我想在rllib中进行训练 我的环境有一些可选参数,我希望在培训时选择这些参数。我认为代码的相关部分在Python 在rllib中注册健身房环境时传递可选参数,python,openai-gym,ray,optional-arguments,rllib,Python,Openai Gym,Ray,Optional Arguments,Rllib,我一直在遵循这个有用的示例在健身房创建一个自定义环境,然后我想在rllib中进行训练 我的环境有一些可选参数,我希望在培训时选择这些参数。我认为代码的相关部分在train.py中: # start Ray -- add `local_mode=True` here for debugging ray.init(ignore_reinit_error=True) # register the custom environment select_env = &quo
train.py
中:
# start Ray -- add `local_mode=True` here for debugging
ray.init(ignore_reinit_error=True)
# register the custom environment
select_env = "example-v0"
register_env(select_env, lambda config: Example_v0())
我尝试过一些显而易见的事情,比如
register_env(select_env, lambda config: Example_v0(optional_arg=n))
但似乎一切都不起作用。在训练前有没有办法传递不同的论点