# Wav2vec2 and hubert export to onnx

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-and-hubert-export-to-onnx%2F8703%3E%5C
**Category:** Models\
**Created:** [July 26, 2021, 5:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-and-hubert-export-to-onnx%2F8703 "2021-07-26T17:20:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasilis](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@vasilis](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvasilis)%5C
**Post date:** [July 26, 2021, 5:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-and-hubert-export-to-onnx%2F8703%2F1 "2021-07-26T17:20:11Z")

</div>

Hi, I am trying to export wav2vec and hubert models to onnx runtime. Exporting seems to work fine using your `transformers.onnx` or by doing it “manually”. But only if the attention mask is `None`. Do you have any pointers as to how the model code could be altered so that loading doesn’t fail with errors like:

```auto
 Type Error: Type 'tensor(bool)' of input parameter (744) of operator (ScatterND) in node (ScatterND_309) is invalid

```

if a mask is passed?
