How to turn off exploration when using RLPredictor?

  • High: It blocks me to complete my task.

Hi experts.

How can I turn off exploration when using ray.train.rl.rl_predictor.RLPredictor?

Tried turning off exploration using the following, but RLPredictor selects different actions for the same state input:

predictor = RLPredictor.from_checkpoint(checkpoint)
predictor.policy.explore = False
predictor.policy.exploration_config = None
states = np.array([state, state, state])
actions = trainer.predict(states)


Did you try predictor.predict(states) instead of trainer.predict ?

Fixed it by simply updating the config dictionary in the policy as shown below:

predictor.policy.config[‘explore’] = False