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: _update_params_on_kvstore() takes exactly 4 arguments (3 given)** #75

Open
xuwentang opened this issue Mar 1, 2019 · 2 comments

Comments

@xuwentang
Copy link

Traceback (most recent call last):
File "experiments/rfcn/rfcn_end2end_train_test.py", line 19, in
train_end2end.main()
File "experiments/rfcn/../../rfcn/train_end2end.py", line 164, in main
config.TRAIN.begin_epoch, config.TRAIN.end_epoch, config.TRAIN.lr, config.TRAIN.lr_step)
File "experiments/rfcn/../../rfcn/train_end2end.py", line 157, in train_net
arg_params=arg_params, aux_params=aux_params, begin_epoch=begin_epoch, num_epoch=end_epoch)
File "experiments/rfcn/../../rfcn/core/module.py", line 969, in fit
self.update()
File "experiments/rfcn/../../rfcn/core/module.py", line 1051, in update
self._curr_module.update()
File "experiments/rfcn/../../rfcn/core/module.py", line 572, in update
self._kvstore)
TypeError: _update_params_on_kvstore() takes exactly 4 arguments (3 given)

@xuwentang
Copy link
Author

@Horacehxw
Copy link

I tried this based on new mxnet documentation and it works fine so far.

def update(self):
       """Update parameters according to the installed optimizer and the gradients computed
       in the previous forward-backward batch.
       """
       assert self.binded and self.params_initialized and self.optimizer_initialized

       self._params_dirty = True
       # FIXME: need 4 arguments here.
       if self._update_on_kvstore:
           _update_params_on_kvstore(self._exec_group.param_arrays,
                                     self._exec_group.grad_arrays,
                                     self._kvstore,
                                     self._exec_group.param_names)
       else:
           _update_params(self._exec_group.param_arrays,
                          self._exec_group.grad_arrays,
                          updater=self._updater,
                          num_device=len(self._context),
                          kvstore=self._kvstore)

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

2 participants