From ray.rllib.agents.registry import get_trainer_class

Hey Guys,

somehow my ray/rllib/agents/registry.py file has no “get_trainer_class” method even if i pip install the newest ray version.

ps. the “get_trainer_class” method is used in the rollout.py file

thx.

Hmm, did you link properly from your git development directory?

Like so:

$ pip install -U [latest wheel]
$ cd [local ray repo]
$ git pull
$ python python/ray/setup-dev.py --yes

This will make sure everything is up to date and pointing to the correct source code files when working with a git fork.

1 Like

No, I just run the command pip install --update ray[rllib] and after this doesn’t work I completely uninstall ray and installed it again (pip install ray==1.20). But this also doesn’t work, so I downloaded the source code zip from the official v1.2.0 release notes (Release Release ray-1.2.0 · ray-project/ray · GitHub). But even in this zip the registry.py file has no “get_trainer_class” method!

Makes sense, b/c this was only added recently (it’s currently only in the master branch, not in any main release yet). So you are using some master-branch script where this is required linking to some install that doesn’t have that function yet.

You have to do:

pip install -U [get the https link to the latest wheel (master) from this URL here: https://docs.ray.io/en/master/installation.html#daily-releases-nightlies]

DO NOT DO:
pip install -U ray[rllib] <- this will only install ray1.2, which doesn't have get_trainer_class yet

1 Like