Farama-Foundation / MAgent2

An engine for high performance multi-agent environments with very large numbers of agents, along with a set of reference environments
https://magent2.farama.org
MIT License
201 stars 34 forks source link

env.reset() #34

Closed Daniel-Huff closed 4 days ago

Daniel-Huff commented 4 months ago

from magent2.environments import battle_v4, adversarial_pursuit_v4, battlefield_v5, combined_arms_v6, gather_v5 from pettingzoo.utils import random_demo

env = battle_v4.env(map_size=16, minimap_mode=False, step_reward=-0.005, dead_penalty=-0.1, attack_penalty=-0.1, attack_opponent_reward=0.2, max_cycles=100000, extra_features=False, render_mode='human') env.reset() random_demo(env, render=True, episodes=1)

but got error:

File "/Users/qinmeng/PycharmProjects/MAHRL/test.py", line 20, in env.reset() File "/opt/homebrew/anaconda3/envs/tianshou/lib/python3.11/site-packages/pettingzoo/utils/wrappers/order_enforcing.py", line 118, in reset super().reset(seed=seed, options=options) File "/opt/homebrew/anaconda3/envs/tianshou/lib/python3.11/site-packages/pettingzoo/utils/wrappers/base.py", line 38, in reset self.env.reset(seed=seed, options=options) File "/opt/homebrew/anaconda3/envs/tianshou/lib/python3.11/site-packages/pettingzoo/utils/wrappers/base.py", line 38, in reset self.env.reset(seed=seed, options=options) File "/opt/homebrew/anaconda3/envs/tianshou/lib/python3.11/site-packages/pettingzoo/utils/conversions.py", line 306, in reset self._observations, self.infos = self.env.reset(seed=seed, options=options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: too many values to unpack (expected 2)

joaopedromattos commented 4 months ago

I guess this might be your solution: #31

Daniel-Huff commented 4 months ago

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. magent2 0.3.2 requires pettingzoo>=1.23.1, but you have pettingzoo 1.22.3 which is incompatible.

Daniel-Huff commented 4 months ago

not work for me, @joaopedromattos got new error

MiangChen commented 1 month ago

I guess this might be your solution: #31

This is helpful. pip install pettingzoo==1.22

jkterry1 commented 4 days ago

Hey, I'm going to close this issue because I believe the underlying issue here was resolved in #31