You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When supplying a wrapped gym environment to RLib, CompleteAction attribute cannot be fetched. This seems to be independent of the chosen environment.
How to reproduce
I reproduce and describe the issue in this notebook.
Current output
The current error message is
AttributeError: Can't get attribute 'CompleteAction_l2rpn_case14_sandbox' on <module 'grid2op.Space.GridObjects' from '/usr/local/lib/python3.7/dist-packages/grid2op/Space/GridObjects.py'>
Expected output
The desired outcome is portrayed in the notebook, ie. RLib can build the gym environment.
The text was updated successfully, but these errors were encountered:
The issue is most likely related to how Ray pickles and passes around the objects.
The fix is to modify the initialisation of the wrapped gym environment.
One must not feed self.observation_space (analogically self.action_space) the gym environment observation space directly, but first serialise it as a dictionary and then feed in a gym Dict space.
d = {k: v for k, v in self.env_gym.observation_space.spaces.items()}
self.observation_space = gym.spaces.Dict(d)
a = {k: v for k, v in self.env_gym.action_space.items()}
self.action_space = gym.spaces.Dict(a)
BDonnot
changed the title
AttributeError: Can't get attribute 'CompleteAction..."env_name"'
AttributeError: Can't get attribute 'CompleteAction..."env_name"' => update the example notebook
Nov 19, 2021
Environment
1.6.4
linux, macOs
Bug description
When supplying a wrapped gym environment to RLib,
CompleteAction
attribute cannot be fetched. This seems to be independent of the chosen environment.How to reproduce
I reproduce and describe the issue in this notebook.
Current output
The current error message is
Expected output
The desired outcome is portrayed in the notebook, ie. RLib can build the gym environment.
The text was updated successfully, but these errors were encountered: