Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rllib] Small fix for supporting custom preprocessors #1334

Merged
merged 3 commits into from
Dec 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/ray/rllib/models/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def get_preprocessor(cls, env, options=dict()):
print("Observation shape is {}".format(obs_shape))

if env_name in cls._registered_preprocessor:
return cls._registered_preprocessor[env_name](options)
return cls._registered_preprocessor[env_name](
env.observation_space, options)

if obs_shape == ():
print("Using one-hot preprocessor for discrete envs.")
Expand Down
2 changes: 1 addition & 1 deletion python/ray/rllib/test/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class FakePreprocessor(Preprocessor):
def __init__(self, options):
def _init(self):
pass


Expand Down