facebookresearch / BenchMARL

A collection of MARL benchmarks based on TorchRL
https://benchmarl.readthedocs.io/
MIT License
233 stars 31 forks source link

Error when using LSTM/GRU model #121

Closed SeaingAnt closed 4 weeks ago

SeaingAnt commented 4 weeks ago

When launching the command line example with LSTM/GRU model for critic or actor, the sync collector breaks with the following error:


KeyError: ('agents', 'episode_reward')

Generated by the following command:

python3 benchmarl/run.py task=vmas/balance algorithm=mappo model=layers/gru model.hidden_size="125" model.mlp_layer_class="torch.nn.Linear" model.mlp_num_cells="[32,32]" model.mlp_activation_class="torch.nn.ReLU"
matteobettini commented 4 weeks ago

Hey!

Thanks a lot for posting!

Could you confirm you are using the latest github versions of benchmarl, torchrl and tensordict?

the RNN models are not yet part of a stable release so therefore for now we have to use the github main code

SeaingAnt commented 4 weeks ago

I'm using the pip version of tensordict and torchrl.

I checked again and the error appears only when using the rnn as actor. For the critic, it is ok.

matteobettini commented 4 weeks ago

The pip version of torchrl and tensordict does not work for now. We are waiting for the next release where I fixed this bug

you need the main versions as of now

SeaingAnt commented 4 weeks ago

Thank you, this works