**TypeError: _update_params_on_kvstore() takes exactly 4 arguments (3 given)**
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)
https://github.com/msracver/Deformable-ConvNets/issues/62#
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)