openai / baselines

OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
MIT License
15.5k stars 4.84k forks source link

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

Open JiyueWang opened 4 years ago

JiyueWang commented 4 years ago

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'

christopherhesse commented 4 years ago

@tanzhenyu

HACLANG commented 4 years ago

Me too +1

ashutoshtiwari13 commented 3 years ago

I am facing the same error.

ashutoshtiwari13 commented 3 years ago

@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.

luizmarao commented 3 years ago

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

luizmarao commented 3 years ago

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.