How PPOTrainer export compute_action function?

how to do this?

programe 1
trainer = ppo.PPOTrainer(config=config)
trainer.get_policy().export_model(“dir”)

programe 2
model = tf.saved_model.load(“dir”)
action = model(obs=[1,2,3,4,5])

Hey @weileze , looks about right.

  • Try to pass in a numpy array instead of a list of obs.
  • For tf static-graph mode (non-eager), you should expect an action tensor, so you’d have to run the action in a tf.Session() to get the actual action value.