mlcommons / mobile_open

MLPerf Mobile benchmarks
https://mlcommons.org/en/groups/inference-mobile/
Apache License 2.0
9 stars 1 forks source link

MobileBERT with SQUAD 1.1 Quantized INT8 Error #3

Open RiponHan opened 2 years ago

RiponHan commented 2 years ago

I download the quantize-aware training int8 model(saved_model.pb) from repo google-research/google-research.And I use run_squad.py which offered in the repo with tensorflow 1.15. https://github.com/google-research/google-research/tree/master/mobilebert/run_squad.py.I also try to convert this model with tensorflow 2.2/2.3/2.5/2.6/2.8-nightly.But it didn't work anymore. You mention about that:

The TensorFlow Lite models are:
quant.tflite - Quantized (int8, per-channel) .tflite model.
quant_nnapi.tflite - Quantized (int8, per-channel) .tflite model with several mathematically equivalent op replacements for NNAPI compatibility.

So I was thinking how do you convert the model to mobilebert_int8_384.tflite and mobilebert_int8_384_nnapi.tflite? Could you please provide some information to help convert the model?