Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem running rllab MazeAntEnv #238

Open
ahq1993 opened this issue Jul 2, 2018 · 2 comments
Open

Problem running rllab MazeAntEnv #238

ahq1993 opened this issue Jul 2, 2018 · 2 comments

Comments

@ahq1993
Copy link

ahq1993 commented Jul 2, 2018

Code:
..
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.normalized_env import normalize
from rllab.envs.mujoco.maze.ant_maze_env import AntMazeEnv

def main(exp_name=None, ent_wt=1.0):
tf.reset_default_graph()
env = normalize(AntMazeEnv())

policy = GaussianMLPPolicy(name='policy', env_spec=env.spec, hidden_sizes=(32, 32))
with tf.Session(config=get_session_config()) as sess:
    algo = TRPO(
        env=env,
        sess=sess,
        policy=policy,
        n_itr=2000,
        batch_size=20000,
        max_path_length=500,
        discount=0.99,
        store_paths=True,
        entropy_weight=ent_wt,
        baseline=LinearFeatureBaseline(env_spec=env.spec),
        exp_name=exp_name,
    )
    with rllab_logdir(algo=algo, dirname='data/ant_data_collect'):#/%s'%exp_name):
        algo.train()

if name == "main":
params_dict = {
'ent_wt': [0.1]
}
main(ent_wt=0.1)

Error:

Traceback (most recent call last):
File "ant_data_collect.py", line 47, in
main(ent_wt=0.1)
File "ant_data_collect.py", line 24, in main
policy = GaussianMLPPolicy(name='policy', env_spec=env.spec, hidden_sizes=(32, 32))
File "/home/ahmed/tf-codes/inverse_rl_orignal_maze/scripts/sandbox/rocky/tf/policies/gaussian_mlp_policy.py", line 56, in init
assert isinstance(env_spec.action_space, Box)
AssertionError

@ahq1993
Copy link
Author

ahq1993 commented Jul 6, 2018

Any suggestion guys?

@ahq1993
Copy link
Author

ahq1993 commented Jul 9, 2018

I also tried with removing normalize() and using CategoricalML policy but then it gives an error at assert isinstance(env_spec.action_space, Discrete).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant