embersarc / ppo Goto Github PK
View Code? Open in Web Editor NEWPPO implementation for OpenAI gym environment based on Unity ML Agents
PPO implementation for OpenAI gym environment based on Unity ML Agents
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 ! ! !
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?
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:
How should I solve these problems ? Please ! ! !
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?
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)
?
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:
How shoule I solve these pronlems ? Please ! ! !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.