FLAIROx / JaxMARL

Multi-Agent Reinforcement Learning with JAX
Apache License 2.0
445 stars 81 forks source link

Failed to Run Baseline iql.py in mpe_spread without parameters sharing #101

Closed iamlilAJ closed 4 months ago

iamlilAJ commented 5 months ago

Traceback (most recent call last): File "/root/autodl-tmp/project/JaxMARL-main/baselines/QLearning/iql.py", line 609, in main outs = jax.block_until_ready(train_vjit(rngs)) ^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/project/JaxMARL-main/baselines/QLearning/iql.py", line 558, in train runner_state, metrics = jax.lax.scan( ^^^^^^^^^^^^^ File "/root/autodl-tmp/project/JaxMARL-main/baselines/QLearning/iql.py", line 403, in _update_step loss, grads = jax.vmap(grad_fn, in_axes=0)( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/project/JaxMARL-main/baselines/QLearning/iql.py", line 392, in _lossfn , q_vals = agent.apply(params, init_hs, (obs, dones)) ^^^^^ NameError: cannot access free variable 'agent' where it is not associated with a value in enclosing scope. Did you mean: 'anext'?

To reproduce the error, python baselines/QLearning/iql.py +alg=iql_mpe +env=mpe_spread and set "PARAMETERS_SHARING": False in iql_mpe.yaml.

Hi there,

it seems that ``agent'' variable is not accessible within the jax.vmap scope.

mttga commented 4 months ago

I'm sorry but we don't support no-parameters sharing anymore