Skip to content

'Dense' object has no attribute 'W' #18

@jiadingfang

Description

@jiadingfang

Hi there,

I'm trying to reproduce the results. But when running the code, I first ran into the Monitor error which caused by the updates of the gym environments. And I fixed myself. But this time, another error occurred as follows

python run_pg.py --gamma=0.995 --lam=0.97 --agent=modular_rl.agentzoo.TrpoAgent --max_kl=0.01 --cg_damping=0.1 --activation=tanh --n_iter=250 --seed=0 --timesteps_per_batch=5000 --env=Pendulum-v0 --outfile=$outdir/Pendulum-v0.h5

Using TensorFlow backend.
[2017-03-15 19:09:35,124] Making new env: Pendulum-v0
Traceback (most recent call last):
File "run_pg.py", line 35, in <module>
agent = agent_ctor(env.observation_space, env.action_space, cfg)
File "/home/kudo/openai/modular_rl/modular_rl/agentzoo.py", line 118, in __init__
policy, self.baseline = make_mlps(ob_space, ac_space, cfg)
File "/home/kudo/openai/modular_rl/modular_rl/agentzoo.py", line 36, in make_mlps
Wlast = net.layers[-1].W
AttributeError: 'Dense' object has no attribute 'W'

It seems that this error is due to the updates of Keras. Do you have an idea how to solve it? And it there a updated version of your library?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions