Skip to content

Commit

Permalink
Add try/catch for interface compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
HaozhiQi committed Dec 26, 2017
1 parent 1cf8e12 commit db4ef25
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
11 changes: 8 additions & 3 deletions deeplab/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,14 @@ def update(self):

self._params_dirty = True
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)
try:
_update_params_on_kvstore(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
self._kvstore)
except:
_update_params_on_kvstore(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
self._kvstore, param_names=self._exec_group.param_names)
else:
_update_params(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
Expand Down
11 changes: 8 additions & 3 deletions faster_rcnn/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,14 @@ def update(self):

self._params_dirty = True
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)
try:
_update_params_on_kvstore(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
self._kvstore)
except:
_update_params_on_kvstore(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
self._kvstore, param_names=self._exec_group.param_names)
else:
_update_params(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
Expand Down
2 changes: 1 addition & 1 deletion fpn/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def update(self):
except:
_update_params_on_kvstore(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
self._kvstore, self._exec_group.param_names)
self._kvstore, param_names=self._exec_group.param_names)
else:
_update_params(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
Expand Down
11 changes: 8 additions & 3 deletions rfcn/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,14 @@ def update(self):

self._params_dirty = True
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)
try:
_update_params_on_kvstore(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
self._kvstore)
except:
_update_params_on_kvstore(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
self._kvstore, param_names=self._exec_group.param_names)
else:
_update_params(self._exec_group.param_arrays,
self._exec_group.grad_arrays,
Expand Down

0 comments on commit db4ef25

Please sign in to comment.