Input API for offline

Hello!

I am exploring offline training in RLlib and I want to be able to write a custom input reader. In the Input API instructions I can see that we should be able to pass “- A callable that returns a ray.rllib.offline.InputReader.” in the “input” feild of the configuration.

I do not seem to be bale to do this even with the standard JsonReader, when is pass "input": JsonReader(logdir-with-json-files), I get the error TypeError: argument of type 'ABCMeta' is not iterable.

How can I pass a custom InputReader?

Hey @fridaksvensson , could you try this via a lambda instead?

config:
    input: lambda io_ctx: JsonReader(logdir-with-json-files),

Note that io_ctx is an InputContext object from ray.rllib.offline.io_context.py::IOContext. This is basically just a dataclass holding self.log_dir, self.config, self.worker_index, and self.worker properties.

Seems to work, thank you!

1 Like