Last active
October 14, 2020 01:43
-
-
Save matthiasplappert/1e4860600275efd00b9b80bcc4a4e2bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import gym | |
env = gym.make('FetchReach-v0') | |
# Simply wrap the goal-based environment using FlattenDictWrapper | |
# and specify the keys that you would like to use. | |
env = gym.wrappers.FlattenDictWrapper( | |
env, dict_keys=['observation', 'desired_goal']) | |
# From now on, you can use the wrapper env as per usual: | |
ob = env.reset() | |
print(ob.shape) # is now just an np.array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to change
FlattenDictWrapper(env, dict_keys=['observation', 'desired_goal'])
toFlattenObservation(FilterObservation(env, ["observation", "desired_goal"]))
https://github.com/openai/baselines/pull/1034/files#diff-06f2d87316632bf8909f91507556c46a278bd62b6d60a5536cfb50eef2b0902bR130