You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered:
I also tried with removing normalize() and using CategoricalML policy but then it gives an error at assert isinstance(env_spec.action_space, Discrete).
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())
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
The text was updated successfully, but these errors were encountered: