Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix block.export #17970

Merged
merged 9 commits into from
Sep 1, 2020
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions python/mxnet/gluon/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,17 @@ def export(self, path, epoch=0, remove_amp_cast=True):
if name in arg_names:
arg_dict['arg:{}'.format(name)] = param._reduce()
else:
assert name in aux_names
arg_dict['aux:{}'.format(name)] = param._reduce()
if name.endswith('running_mean') or name.endswith('running_var') \
or name.endswith('moving_mean') or name.endswith('moving_var'):
if name not in aux_names:
warnings.warn('Parameter "{name}" is not found in '
'the graph. '
.format(name=name), stacklevel=3)
else:
warnings.warn('Parameter "{name}" is not found in '
'the graph. '
.format(name=name), stacklevel=3)
arg_dict['aux:%s'%name] = param._reduce()
chinakook marked this conversation as resolved.
Show resolved Hide resolved
save_fn = _mx_npx.save if is_np_array() else ndarray.save
params_filename = '%s-%04d.params'%(path, epoch)
save_fn(params_filename, arg_dict)
Expand Down