From b7eb120956012a90ac44c721c18c218c0afbb8d0 Mon Sep 17 00:00:00 2001 From: Guy Jacob <guy.jacob@intel.com> Date: Tue, 22 Oct 2019 14:50:56 +0300 Subject: [PATCH] Set fixed_subset in data loader for image classifiers stats collection (since stats collection is now a 2-phase process) --- distiller/apputils/image_classifier.py | 2 +- distiller/quantization/ptq_greedy_search.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/distiller/apputils/image_classifier.py b/distiller/apputils/image_classifier.py index 3aa1fe7..abc1567 100755 --- a/distiller/apputils/image_classifier.py +++ b/distiller/apputils/image_classifier.py @@ -838,7 +838,7 @@ def acts_quant_stats_collection(model, criterion, loggers, args): .format(args.qe_calibration)) model = distiller.utils.make_non_parallel_copy(model) args.effective_test_size = args.qe_calibration - test_loader = load_data(args, load_train=False, load_val=False) + test_loader = load_data(args, fixed_subset=True, load_train=False, load_val=False) test_fn = partial(test, test_loader=test_loader, criterion=criterion, loggers=loggers, args=args, activations_collectors=None) collect_quant_stats(model, test_fn, save_dir=msglogger.logdir, diff --git a/distiller/quantization/ptq_greedy_search.py b/distiller/quantization/ptq_greedy_search.py index 1f361fe..2b5d96f 100644 --- a/distiller/quantization/ptq_greedy_search.py +++ b/distiller/quantization/ptq_greedy_search.py @@ -439,7 +439,7 @@ if __name__ == "__main__": # quant calibration dataloader: args.effective_test_size = args.qe_calib_portion args.batch_size = args.qe_calib_batchsize - calib_data_loader = classifier.load_data(args, load_train=False, load_val=False) + calib_data_loader = classifier.load_data(args, fixed_subset=True, load_train=False, load_val=False) # logging logging.getLogger().setLevel(logging.WARNING) msglogger = logging.getLogger(__name__) -- GitLab