# Error while converting the model: Module onnx is not installed!

**URL:** <https://discuss.huggingface.co/t/error-while-converting-the-model-module-onnx-is-not-installed/95028>\
**Category:** Beginners\
**Created:** [July 1, 2024, 10:01pm UTC](https://discuss.huggingface.co/t/error-while-converting-the-model-module-onnx-is-not-installed/95028 "2024-07-01T22:01:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbalseiro](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@cbalseiro](https://discuss.huggingface.co/u/cbalseiro)\
**Post date:** [July 1, 2024, 10:01pm UTC](https://discuss.huggingface.co/t/error-while-converting-the-model-module-onnx-is-not-installed/95028/1 "2024-07-01T22:01:36Z")

</div>

I tried to use the Exporting Model feature using the example in this [page](https://huggingface.co/transformers/v3.3.1/serialization.html#onnx-onnxruntime)

```auto
python convert_graph_to_onnx.py --framework pt --model bert-base-cased bert-base-cased.onnx

```

I got an error that I need to use ONNX opset version 14 so I Used this:

```auto
python convert_graph_to_onnx.py --framework pt --opset 14 --model bert-base-cased bert-base-cased.onnx

```

And I got this Error :

====== Converting model to ONNX ======  
convert\_graph\_to\_onnx.py:361: FutureWarning: The `transformers.convert_graph_to_onnx` package is deprecated and will be removed in version 5 of Transformers  
warnings.warn(  
ONNX opset version set to: 14  
Loading pipeline (model: bert-base-cased, tokenizer: bert-base-cased)  
Using framework PyTorch: 2.3.1+cpu  
Found input input\_ids with shape: {0: ‘batch’, 1: ‘sequence’}  
Found input token\_type\_ids with shape: {0: ‘batch’, 1: ‘sequence’}  
Found input attention\_mask with shape: {0: ‘batch’, 1: ‘sequence’}  
Found output output\_0 with shape: {0: ‘batch’, 1: ‘sequence’}  
Found output output\_1 with shape: {0: ‘batch’}  
Ensuring inputs are in correct order  
position\_ids is not present in the generated input list.  
Generated inputs order: [‘input\_ids’, ‘attention\_mask’, ‘token\_type\_ids’]  
Error while converting the model: Module onnx is not installed!  
I have onnx==1.16.1 installed  
Could somebody help me?
