neural-compressor
neural-compressor copied to clipboard
BUG: Unexpected exception TypeError("_post_eval_hook() got an unexpected keyword argument 'accuracy'") happened during tuning.
When I use tf2.5 with NIC, I want to use tensorboard, and my conf is
version: 1.0
model: # mandatory. used to specify model specific information.
name: origin_model
framework: tensorflow # mandatory. supported values are tensorflow, pytorch, pytorch_ipex, onnxrt_integer, onnxrt_qlinear or mxnet; allow new framework backend extension.
quantization: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
calibration:
sampling_size: 10000 # optional. default value is 100. used to set how many samples should be used in calibration.
model_wise: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
activation:
algorithm: minmax
# op_wise: {
# 'import/dnn/hiddenlayer_0/MatMul': {
# 'activation': {'dtype': ['uint8'], 'algorithm': ['minmax'], 'scheme':['asym']},
# }
# }
tuning:
tensorboard: true
accuracy_criterion:
relative: 0.01 # optional. default value is relative, other value is absolute. this example allows relative accuracy loss: 1%.
exit_policy:
timeout: 0 # optional. tuning timeout (seconds). default value is 0 which means early stop. combine with max_trials field to decide when to exit.
max_trials: 100 # optional. max tune times. default value is 100. combine with timeout field to decide when to exit.
random_seed: 9527
Then I got this error, Is a Bug 2022-04-07 11:03:00 [ERROR] Unexpected exception TypeError("_post_eval_hook() got an unexpected keyword argument 'accuracy'") happened during tuning. Traceback (most recent call last): File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/neural_compressor/experimental/quantization.py", line 151, in execute self.strategy.traverse() File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/neural_compressor/strategy/strategy.py", line 323, in traverse self.baseline = self._evaluate(self.model) File "/root/anaconda3/envs/tf2/lib/python3.7/site-packages/neural_compressor/strategy/strategy.py", line 463, in _evaluate self.adaptor._post_eval_hook(model, accuracy=val[0])
The tensorflow adaptor not has accuracy params, So raise the execption, You have pass it, So tensorboard in NIC is not avaliable now!
thanks for the feedback. we will take a look on that
Hi @GuoGuiRong,
Thank you for reporting the bug. It's fixed in our next release.