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

Fix the quantization script to support Python2 #13700

Merged
merged 2 commits into from
Dec 23, 2018
Merged
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions example/quantization/imagenet_gen_qsym_mkldnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ def save_params(fname, arg_params, aux_params, logger=None):
logger.info('rgb_std = %s' % rgb_std)
rgb_std = [float(i) for i in rgb_std.split(',')]
std_args = {'std_r': rgb_std[0], 'std_g': rgb_std[1], 'std_b': rgb_std[2]}

combine_mean_std = {}
combine_mean_std.update(mean_args)
combine_mean_std.update(std_args)
if calib_mode == 'none':
logger.info('Quantizing FP32 model %s' % args.model)
qsym, qarg_params, aux_params = quantize_model(sym=sym, arg_params=arg_params, aux_params=aux_params,
Expand All @@ -294,8 +296,7 @@ def save_params(fname, arg_params, aux_params, logger=None):
shuffle=args.shuffle_dataset,
shuffle_chunk_seed=args.shuffle_chunk_seed,
seed=args.shuffle_seed,
**mean_args,
**std_args)
**combine_mean_std)

qsym, qarg_params, aux_params = quantize_model(sym=sym, arg_params=arg_params, aux_params=aux_params,
ctx=ctx, excluded_sym_names=excluded_sym_names,
Expand Down