baselines icon indicating copy to clipboard operation
baselines copied to clipboard

TypeError: mlp() got an unexpected keyword argument 'value_network'

Open JiyueWang opened this issue 5 years ago • 6 comments

After installation of tf2 version, I tried to run the check command in readme I got the error above

python -m baselines.run --alg=ppo2 --env=Humanoid-v2 --network=mlp --num_timesteps=2e7 Logging to /tmp/openai-2019-10-30-11-49-36-171979 env_type: mujoco Training ppo2 on mujoco:Humanoid-v2 with arguments {'nsteps': 2048, 'nminibatches': 32, 'lam': 0.95, 'gamma': 0.99, 'noptepochs': 10, 'log_interval': 1, 'ent_coef': 0.0, 'lr': <function mujoco.. at 0x7fdc5279a3b0>, 'cliprange': 0.2, 'value_network': 'copy', 'network': 'mlp'} Traceback (most recent call last): File "/home/jiyue/anaconda3/envs/baselinetf2/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/jiyue/anaconda3/envs/baselinetf2/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/jiyue/pytorchProjects/baselines-tf2/baselines/run.py", line 249, in main(sys.argv) File "/home/jiyue/pytorchProjects/baselines-tf2/baselines/run.py", line 209, in main model, env = train(args, extra_args) File "/home/jiyue/pytorchProjects/baselines-tf2/baselines/run.py", line 79, in train **alg_kwargs File "/home/jiyue/pytorchProjects/baselines-tf2/baselines/ppo2/ppo2.py", line 96, in learn policy_network_fn = get_network_builder(network_type)(**network_kwargs) TypeError: mlp() got an unexpected keyword argument 'value_network'

JiyueWang avatar Oct 30 '19 03:10 JiyueWang

@tanzhenyu

christopherhesse avatar Nov 08 '19 22:11 christopherhesse

Me too +1

HACLANG avatar Jul 06 '20 12:07 HACLANG

I am facing the same error.

ashutoshtiwari13 avatar Jul 23 '20 04:07 ashutoshtiwari13

@christopherhesse Can you please tell why are we using the value_network parameter in baselines/baselines/ppo2/defaults.py also the README indicates it. Asking as i could get through the error by removing the parameter from the defaults.

ashutoshtiwari13 avatar Jul 24 '20 16:07 ashutoshtiwari13

I'm also facing this error. Still have no idea how to fix it.

luizmarao avatar Oct 08 '20 18:10 luizmarao

Solved adding **mlp_kwargs in mlp() implementation. Not sure if it will lead to another problem later, but the code runs, apparently with no problems.

luizmarao avatar Oct 08 '20 21:10 luizmarao