EmbersArc / PPO

PPO implementation for OpenAI gym environment based on Unity ML Agents
148 stars 21 forks source link

Errors when running ppo.y : Failed on kwargs for b2PolygonShape.vertices: count >= 3 #2

Closed timelong closed 6 years ago

timelong commented 6 years ago

I copied the rocket_lander.py to gym/envs/box2d/, and modified the init.py in env/ and box2d/ . Then when I run the ppo.py, it gave me these errors:


from ._conv import register_converters as _register_converters Traceback (most recent call last): File "/home/tl/PycharmProjects/testbox2D/PPO/ppo.py", line 64, in env = GymEnvironment(env_name=env_name, log_path="./PPO_log", skip_frames=6) File "/home/tl/PycharmProjects/testbox2D/PPO/agents/environment.py", line 19, in init self.env = gym.make(env_name) File "/home/tl/anaconda2/envs/gymlab/gym/gym/envs/registration.py", line 163, in make return registry.make(id) File "/home/tl/anaconda2/envs/gymlab/gym/gym/envs/registration.py", line 119, in make env = spec.make() File "/home/tl/anaconda2/envs/gymlab/gym/gym/envs/registration.py", line 86, in make env = cls(self._kwargs) File "/home/tl/anaconda2/envs/gymlab/gym/gym/envs/box2d/rocket_lander.py", line 141, in init self.reset() File "/home/tl/anaconda2/envs/gymlab/gym/gym/envs/box2d/rocket_lander.py", line 187, in reset shape=polygonShape(vertices=((0, 0), (W, 0), (W, self.terrainheigth), (0, self.terrainheigth))), File "/home/tl/anaconda2/lib/python2.7/site-packages/Box2D/Box2D.py", line 2926, in init _init_kwargs(self, kwargs) File "/home/tl/anaconda2/lib/python2.7/site-packages/Box2D/Box2D.py", line 136, in _init_kwargs % (self.class.name, key, ex)) AssertionError: Failed on kwargs for b2PolygonShape.vertices: count >= 3 Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/home/tl/anaconda2/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, *kargs) File "/home/tl/PycharmProjects/testbox2D/PPO/agents/environment.py", line 136, in close self.env.close() AttributeError: 'GymEnvironment' object has no attribute 'env' Error in sys.exitfunc: Traceback (most recent call last): File "/home/tl/anaconda2/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(targs, **kargs) File "/home/tl/PycharmProjects/testbox2D/PPO/agents/environment.py", line 136, in close self.env.close() AttributeError: 'GymEnvironment' object has no attribute 'env'

How shoule I solve these pronlems ? Please ! ! !