google-deepmind / meltingpot

A suite of test scenarios for multi-agent reinforcement learning.
Apache License 2.0
583 stars 118 forks source link

Problems running examples/rllib/view_models.py #110

Closed ninell-oldenburg closed 1 year ago

ninell-oldenburg commented 1 year ago

Hi,

I've tried training examples on different environments, e.g., commons_harvest__open and clean_up but I am running into the following error when trying to execute view_models.py

File "/Users/nell/Documents/GitHub/social-contracts/examples/rllib/utils.py", line 183, in initial_state
    return self._model.get_policy(self._policy_id).get_initial_state()
AttributeError: 'NoneType' object has no attribute 'get_initial_state'

As self._policy_id is coming out as "av", I've also tried setting it to the current version of ray's sample_batch.py "default_policy" but nothing changed.

It's running on MacOs M1 chip Python 3.10.8 Ray version 2.0.0

Thank you in advance!

willis-richard commented 1 year ago

This is because view_models is loading a hardcoded policy "av". Now that self_playtrain.py has changed to name policies `f"agent{i}", where i is a range oversubstrate.get_config(substrate_name).default_player_roles,` this line will need to be updated to reflect that change.