Coder Social home page Coder Social logo

ppo's People

Contributors

embersarc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ppo's Issues

How to load the trained model

I am trying to run a trained model from the working_model directory.
I set the load_model = True and
model_path = ./working_model/models

But it doesn't read the working model. Am I missing something?

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

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 ! ! !

Probability of Action

I am looking into your code (which is pretty clean and clear by the way) and have a question for a line of code.

In the file PPO/ppo/model.py, line 185

r_theta = probs / (old_probs + 1e-10)

Would it be more accurate to modify it into
r_theta = tf.reduce_prod(probs,axis=-1) / (tf.reduce_prod(old_probs,axis=-1) + 1e-10)
?

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

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 ! ! !

No registered env with id: RocketLander-v0

Traceback (most recent call last):
File "/home/sajan/gym/gym/envs/registration.py", line 159, in spec
return self.env_specs[id]
KeyError: 'RocketLander-v0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "ppo.py", line 64, in
env = GymEnvironment(env_name=env_name, log_path="./PPO_log", skip_frames=6)
File "/home/sajan/Documents/PPO-master/agents/environment.py", line 19, in init
self.env = gym.make(env_name)
File "/home/sajan/gym/gym/envs/registration.py", line 183, in make
return registry.make(id, **kwargs)
File "/home/sajan/gym/gym/envs/registration.py", line 125, in make
spec = self.spec(path)
File "/home/sajan/gym/gym/envs/registration.py", line 169, in spec
raise error.UnregisteredEnv('No registered env with id: {}'.format(id))
gym.error.UnregisteredEnv: No registered env with id: RocketLander-v0
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/sajan/Documents/PPO-master/agents/environment.py", line 136, in close
self.env.close()
AttributeError: 'GymEnvironment' object has no attribute 'env'

I am getting this error even after making changes and making a gym environment name RocketLander-v0. I don't know what i am doing wrong?

Errors when running PPO:b2PolygonShape.vertices: count >= 3

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 should I solve these problems ? Please ! ! !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.