-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Trying to quantize distilbert-base-uncased-distilled-squad model using the conversion tool in Transformers library from HuggingFace.
python convert_graph_to_onnx.py --framework pt --opset 13 --pipeline question-answering --quantize --model distilbert-base-uncased-distilled-squad distilbert-base-uncased-distilled-squad_quant.onnx
The script imports the following:
import onnx
from onnxruntime.quantization import QuantizationMode, quantize
and then loads the model.
Getting this error at this point: Error while converting the model: attempted relative import beyond top-level package
Urgency
If there are particular important use cases blocked by this or strict project-related timelines, please share more information and dates. If there are no hard deadlines, please specify none.
System information
- Windows 10
- ONNX Runtime installed: binary
- ONNX Runtime version:v1.8.1
- Python version:Python 3.9.6
- Visual Studio version (if applicable): NA
- GCC/Compiler version (if compiling from source): NA
- CUDA/cuDNN version: NA
- GPU model and memory: NA
Expected behavior
Produce a quantized model