# Optimum Exporter TFLite error

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-exporter-tflite-error%2F40156%3E%5C
**Category:** 🤗Optimum\
**Created:** [May 17, 2023, 10:35am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-exporter-tflite-error%2F40156 "2023-05-17T10:35:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aroger](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@aroger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faroger)%5C
**Post date:** [May 17, 2023, 10:35am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-exporter-tflite-error%2F40156%2F1 "2023-05-17T10:35:05Z")

</div>

Hello,  
I’m currently trying to export my Distilbert model to TFLite using the Optimum-cli :

optimum-cli export tflite --model my\_model\_path --task ‘text-classification’ --sequence\_length 128 tflite\_directory\_path

It’s a DistilbertForSequenceClassification model

```auto
2023-05-17 10:18:29.684852: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F AVX512_VNNI FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-05-17 10:18:29.828933: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-05-17 10:18:29.866055: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
/databricks/python/lib/python3.9/site-packages/scipy/ __init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.5
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
Traceback (most recent call last):
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-2050d359-7326-4f12-b563-0e4d5ea5bbe7/bin/optimum-cli", line 8, in <module>
    sys.exit(main())
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-2050d359-7326-4f12-b563-0e4d5ea5bbe7/lib/python3.9/site-packages/optimum/commands/optimum_cli.py", line 162, in main
    service = args.func(args)
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-2050d359-7326-4f12-b563-0e4d5ea5bbe7/lib/python3.9/site-packages/optimum/commands/base.py", line 90, in defaults_factory
    return self. __class__ (
TypeError: __init__ () got multiple values for argument 'parser'

```

---

<div class="post-metadata">

**Author:** ![regisss](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/regisss/32/22467_2.png) [@regisss](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fregisss)%5C
**Post date:** [May 17, 2023, 4:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-exporter-tflite-error%2F40156%2F2 "2023-05-17T16:38:09Z")

</div>

Hi @aroger! Indeed I got the same error. We are going to look into it.

In the meantime, you can export your model to TFLite with the following command:

```auto
python3 -m optimum.exporters.tflite --model my_model_path --task text-classification --sequence_length 128 tflite_directory_path

```

---

<div class="post-metadata">

**Author:** ![regisss](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/regisss/32/22467_2.png) [@regisss](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fregisss)%5C
**Post date:** [May 18, 2023, 8:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-exporter-tflite-error%2F40156%2F3 "2023-05-18T08:21:35Z")

</div>

@aroger We just released a patch, could you upgrade Optimum with `pip install --upgrade optimum` and try again please?

---

<div class="post-metadata">

**Author:** ![aroger](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@aroger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faroger)%5C
**Post date:** [May 18, 2023, 11:23am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-exporter-tflite-error%2F40156%2F4 "2023-05-18T11:23:57Z")

</div>

Hi @regisss, imma try it today. i keep you in touch.  
Thank you for the replies

---

<div class="post-metadata">

**Author:** ![aroger](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@aroger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faroger)%5C
**Post date:** [May 18, 2023, 11:43am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-exporter-tflite-error%2F40156%2F5 "2023-05-18T11:43:16Z")

</div>

@regisss, ça fonctionne désormais! merci
