openai / maddpg

Code for the MADDPG algorithm from the paper "Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments"
https://arxiv.org/pdf/1706.02275.pdf
MIT License
1.66k stars 494 forks source link

displaying agent behaviors on the screen #14

Closed williamyuanv0 closed 6 years ago

williamyuanv0 commented 6 years ago

Hi,I want to display agent behaviors on the screen,but when I change the default value of "--display" to be True,I get an error:

Using good policy maddpg and adv policy maddpg Loading previous state... Starting iterations... agent 1 to agent 0: agent 2 to agent 0: agent 0 to agent 1: agent 2 to agent 1: agent 0 to agent 2: agent 1 to agent 2:
Traceback (most recent call last):

File "", line 1, in runfile('/home/***/Desktop/maddpg-master-new/experiments/train.py', wdir='/home/yuanweilin/Desktop/maddpg-master-new/experiments')

File "/home/***/anaconda3/envs/tensorflow/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile execfile(filename, namespace)

File "/home/***/anaconda3/envs/tensorflow/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "/home/***/Desktop/maddpg-master-new/experiments/train.py", line 198, in train(arglist)

File "/home/***/Desktop/maddpg-master-new/experiments/train.py", line 155, in train env.render()

File "/home/***/Desktop/multiagent-particle-envs-master-new/multiagent/environment.py", line 220, in render self.viewers[i] = rendering.Viewer(700,700)

File "/home/***/Desktop/multiagent-particle-envs-master-new/multiagent/rendering.py", line 52, in init self.window = pyglet.window.Window(width=width, height=height, display=display)

File "/home/***/anaconda3/envs/tensorflow/lib/python3.5/site-packages/pyglet/window/init.py", line 504, in init screen = display.get_default_screen()

File "/home/***/anaconda3/envs/tensorflow/lib/python3.5/site-packages/pyglet/canvas/base.py", line 73, in get_default_screen return self.get_screens()[0]

File "/home/***/anaconda3/envs/tensorflow/lib/python3.5/site-packages/pyglet/canvas/base.py", line 65, in get_screens raise NotImplementedError('abstract')

NotImplementedError: abstract

njfdiem commented 5 years ago

@awesome-xiaoy hey how did you solve this?