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

TypeError: __init__() got unexpected keyword argument(s) 'bias' #11

Open
ajboloor opened this issue Nov 8, 2018 · 0 comments
Open

TypeError: __init__() got unexpected keyword argument(s) 'bias' #11

ajboloor opened this issue Nov 8, 2018 · 0 comments

Comments

@ajboloor
Copy link

ajboloor commented Nov 8, 2018

Command:

python3 run_RL.py --city-name Town01 --corl-2017

Error:

Traceback (most recent call last):
  File "run_RL.py", line 77, in <module>
    model_file='agent/trained_model/9600000.h5', n_actions=9, frameskip=1)
  File "/home/user/projects/carla-0.8.2/PythonClient/reinforcement-learning/agent/runnable_model.py", line 26, in __init__
    self.setup_model(self.n_actions, self.n_meas, self.args)
  File "/home/user/projects/carla-0.8.2/PythonClient/reinforcement-learning/agent/runnable_model.py", line 64, in setup_model
    self.model = run_train_test.get_model(n_actions, n_meas, args)
  File "/home/user/projects/carla-0.8.2/PythonClient/reinforcement-learning/agent/asyncrl/run_train_test.py", line 101, in get_model
    n_input_channels=args.n_images_to_accum, nonlinearity_str=args.nonlinearity, weight_init_str=args.weight_init, bias_init=args.bias_init)
  File "/home/user/projects/carla-0.8.2/PythonClient/reinforcement-learning/agent/asyncrl/run_train_test.py", line 65, in __init__
    self.dqn_net = dqn_head.NatureDQNHead(n_input_channels=n_input_channels, nonlinearity_str=nonlinearity_str, bias=bias_init)
  File "/home/user/projects/carla-0.8.2/PythonClient/reinforcement-learning/agent/asyncrl/dqn_head.py", line 18, in __init__
    L.Convolution2D(n_input_channels, 32, 8, stride=4, bias=bias),
  File "/home/user/.local/lib/python3.5/site-packages/chainer/links/connection/convolution_2d.py", line 124, in __init__
    ('dilate', 1), ('groups', 1))
  File "/home/user/.local/lib/python3.5/site-packages/chainer/utils/argument.py", line 18, in parse_kwargs
    raise TypeError(message)
TypeError: __init__() got unexpected keyword argument(s) 'bias'

with chainer==4.3.1

Fix:
Change all L.Convolution2D params in reinforcement-learning/agent/asyncrl/dqn_head.py:

L.Convolution2D(n_input_channels, 32, 8, stride=4, bias=bias),

to (base -> initial_bias)

L.Convolution2D(n_input_channels, 32, 8, stride=4, initial_bias=bias),

Reference: http://docs.chainer.org/en/stable/reference/generated/chainer.links.Convolution2D.html

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