How severe does this issue affect your experience of using Ray?
High: It blocks me to complete my task.
I am trying to upgrade from Ray 1.8.0 to Ray 1.9.2 (and later hopefully to the latest version) in our code base.
After the upgrade, I have multiple tests failing because we had been using PPOTorchPolicy.with_updates(...), which seems to be gone in 1.9.2. For example, we used to have
In Ray 1.9.2 this fails with AttributeError: type object 'PPOTorchPolicy' has no attribute 'with_updates'. How can I achieve the same behavior for the above with Ray 1.9.2+?
As a quick fix, I went with @Lars_Simon_Zehnder suggestion, which seems to work fine for now. I just had to already define some of the functions in the build_policy_class:
Thanks for the timely question.
You are right, we are deprecating the builder pattern for Trainers and Policies, and in general prefer simple subclassing everywhere.
I will hopefully migrating all the policy classes in the next couple of weeks, including both TF and Torch policies.
You should be able to simply sub-class PPOTorchPolicy for your use case?
Thanks again.
Hi @gjoliver , thanks for the quick response and for clarifying the roadmap.
Yes, sub-classing PPOTorchPolicy works perfectly fine. I was now wondering about sub-classing DQNTFPolicy. Can I also subclass that or what’s the best practice here at the moment?