google / brain-tokyo-workshop

🧠🗼
Apache License 2.0
1.25k stars 331 forks source link

Hi,I have some problems when I run the vae_racing in prettyNEAT? #13

Open BCWang93 opened 4 years ago

BCWang93 commented 4 years ago

when I run the neat_train.py use the vaeRacer.json,I get this error: Traceback (most recent call last): File "neat_train.py", line 279, in main(args)
File "neat_train.py", line 255, in main slave() File "neat_train.py", line 196, in slave result = task.getFitness(wVec, aVec) # process it File "/home/a/Bcw_data/rl-ga-neat-alg/Google-WANN/WANNRelease/prettyNEAT/domain/task_gym.py", line 61, in getFitness reward[iRep] = self.testInd(wVec, aVec, view=view, seed=seed+iRep) File "/home/a/Bcw_data/rl-ga-neat-alg/Google-WANN/WANNRelease/prettyNEAT/domain/task_gym.py", line 84, in testInd state = self.env.reset() File "/home/a/Bcw_data/rl-ga-neat-alg/Google-WANN/WANNRelease/prettyNEAT/domain/vae_racing.py", line 57, in reset return super(VAERacing, self).reset() File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/gym/envs/box2d/car_racing.py", line 311, in reset return self.step(None)[0] File "/home/a/Bcw_data/rl-ga-neat-alg/Google-WANN/WANNRelease/prettyNEAT/domain/vae_racing.py", line 67, in step self.render("rgb_array") File "/home/a/Bcw_data/rl-ga-neat-alg/Google-WANN/WANNRelease/prettyNEAT/domain/vae_racing.py", line 62, in render return super(VAERacing, self).render(mode=mode) File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/gym/envs/box2d/car_racing.py", line 346, in render from gym.envs.classic_control import rendering File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/gym/envs/classic_control/rendering.py", line 27, in from pyglet.gl import File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/gl/init.py", line 239, in import pyglet.window File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/window/init.py", line 1896, in gl._create_shadow_window() File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/gl/init.py", line 208, in _create_shadow_window _shadow_window = Window(width=1, height=1, visible=False) File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/window/xlib/init.py", line 166, in init super(XlibWindow, self).init(args, **kwargs) File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/window/init.py", line 501, in init display = get_platform().get_default_display() File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/window/init.py", line 1845, in get_default_display return pyglet.canvas.get_display() File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/canvas/init.py", line 82, in get_display return Display() File "/home/a/anaconda3/envs/bcw_env/lib/python3.6/site-packages/pyglet/canvas/xlib.py", line 86, in init raise NoSuchDisplayException('Cannot connect to "%s"' % name) pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None" Can you help me to solve this problem?It looks like the problem is I use the env.render() in server?Can I close the env.render() in vaeracing?Thanks!

agaier commented 4 years ago

Hey, it is necessary to render the environment (the input is the pixels screen). Are you running this on something headless (is there really no display?). If you are trying to run headless you will have to use something like xvfb.

e.g. something like this: xvfb-run -a -s "-screen 0 1400x900x24 +extension RANDR" -- <your command>

BCWang93 commented 4 years ago

Hey, it is necessary to render the environment (the input is the pixels screen). Are you running this on something headless (is there really no display?). If you are trying to run headless you will have to use something like xvfb.

e.g. something like this: xvfb-run -a -s "-screen 0 1400x900x24 +extension RANDR" -- <your command>

Thanks for your reply!I run this program in server,and the server hasn't monitor.So,can I use this method to run this program?Thank you very much!

agaier commented 4 years ago

that's right. no problem!

BCWang93 commented 4 years ago

that's right. no problem!

Hi,I have another question want to ask?Can I change the windows,for example change windows to 640x320?Thank you very much!

agaier commented 4 years ago

It should be no problem -- but remember for the racing domain the input is the pixels, so if the virtual screen is smaller than number of pixels it will probably be a problem.