Skip to content

Unable to convert models #2371

@serialhex

Description

@serialhex

System Info

Latest optimum-cli
Python 3.13.5
Windows 11

Who can help?

@echarlaix, @IlyasMoutawwakil trying to use the CLI, and I can't export models:

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction (minimal, reproducible, runnable)

optimum-cli export onnx --model soob3123/amoral-gemma3-12B-v2 --monolith --task image-to-text .\amoral-gemma3-12B-v2-onnx
C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\torch\onnx\_internal\registration.py:162: OnnxExporterWarning: Symbolic function 'aten::scaled_dot_product_attention' already registered for opset 14. Replacing the existing function with new function. This is unexpected. Please report it on https://github.com/pytorch/pytorch/issues.
  warnings.warn(
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:42<00:00,  8.51s/it]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\User\.local\bin\optimum-cli.exe\__main__.py", line 10, in <module>
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\commands\optimum_cli.py", line 219, in main
    service.run()
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\commands\export\onnx.py", line 264, in run
    main_export(
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\exporters\onnx\__main__.py", line 399, in main_export
    onnx_export_from_model(
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\exporters\onnx\convert.py", line 936, in onnx_export_from_model
    raise ValueError(
ValueError: Trying to export a gemma3 model, that is a custom or unsupported architecture, but no custom onnx configuration was passed as `custom_onnx_configs`. Please refer to https://huggingface.co/docs/optimum/main/en/exporters/onnx/usage_guides/export_a_model#custom-export-of-transformers-models for an example on how to export custom models. Please open an issue at https://github.com/huggingface/optimum/issues if you would like the model type gemma3 to be supported natively in the ONNX export.

and

optimum-cli export onnx --model prithivMLmods/Qwen2.5-VL-7B-Abliterated-Caption-it Qwen2.5-VL-7B-Abliterated-Caption-it-onnx
C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\torch\onnx\_internal\registration.py:162: OnnxExporterWarning: Symbolic function 'aten::scaled_dot_product_attention' already registered for opset 14. Replacing the existing function with new function. This is unexpected. Please report it on https://github.com/pytorch/pytorch/issues.
  warnings.warn(
config.json: 3.25kB [00:00, 3.24MB/s]
C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\huggingface_hub\file_download.py:143: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\User\.cache\huggingface\hub\models--prithivMLmods--Qwen2.5-VL-7B-Abliterated-Caption-it. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.
To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development
  warnings.warn(message)
model.safetensors.index.json: 57.6kB [00:00, ?B/s]
Fetching 5 files:   0%|                                                                                                                                                                   | 0/5 [00:00<?, ?it/s]Xet Storage is enabled for this repo, but the 'hf_xet' package is not installed. Falling back to regular HTTP download. For better performance, install the package with: `pip install huggingface_hub[hf_xet]` or `pip install hf_xet`
Xet Storage is enabled for this repo, but the 'hf_xet' package is not installed. Falling back to regular HTTP download. For better performance, install the package with: `pip install huggingface_hub[hf_xet]` or `pip install hf_xet`
Xet Storage is enabled for this repo, but the 'hf_xet' package is not installed. Falling back to regular HTTP download. For better performance, install the package with: `pip install huggingface_hub[hf_xet]` or `pip install hf_xet`
Xet Storage is enabled for this repo, but the 'hf_xet' package is not installed. Falling back to regular HTTP download. For better performance, install the package with: `pip install huggingface_hub[hf_xet]` or `pip install hf_xet`
Xet Storage is enabled for this repo, but the 'hf_xet' package is not installed. Falling back to regular HTTP download. For better performance, install the package with: `pip install huggingface_hub[hf_xet]` or `pip install hf_xet`
model-00005-of-00005.safetensors: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.09G/1.09G [00:56<00:00, 19.2MB/s]
model-00001-of-00005.safetensors: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.90G/3.90G [01:26<00:00, 45.0MB/s]
model-00003-of-00005.safetensors: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.86G/3.86G [02:10<00:00, 29.5MB/s]
model-00004-of-00005.safetensors: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.86G/3.86G [02:26<00:00, 26.5MB/s]
model-00002-of-00005.safetensors: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.86G/3.86G [02:27<00:00, 26.3MB/s]
Fetching 5 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [02:27<00:00, 29.60s/it]
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:30<00:00,  6.20s/it]
generation_config.json: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 238/238 [00:00<?, ?B/s]
tokenizer_config.json: 4.76kB [00:00, 1.59MB/s]
vocab.json: 2.78MB [00:00, 94.8MB/s]
merges.txt: 1.67MB [00:00, 223MB/s]
Xet Storage is enabled for this repo, but the 'hf_xet' package is not installed. Falling back to regular HTTP download. For better performance, install the package with: `pip install huggingface_hub[hf_xet]` or `pip install hf_xet`
tokenizer.json: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11.4M/11.4M [00:00<00:00, 97.5MB/s]
added_tokens.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 605/605 [00:00<00:00, 403kB/s]
special_tokens_map.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 613/613 [00:00<?, ?B/s]
chat_template.jinja: 1.02kB [00:00, 1.02MB/s]
preprocessor_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 575/575 [00:00<00:00, 575kB/s]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\User\.local\bin\optimum-cli.exe\__main__.py", line 10, in <module>
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\commands\optimum_cli.py", line 219, in main
    service.run()
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\commands\export\onnx.py", line 264, in run
    main_export(
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\exporters\onnx\__main__.py", line 399, in main_export
    onnx_export_from_model(
  File "C:\Users\User\AppData\Roaming\uv\tools\optimum\Lib\site-packages\optimum\exporters\onnx\convert.py", line 936, in onnx_export_from_model
    raise ValueError(
ValueError: Trying to export a qwen2_5_vl model, that is a custom or unsupported architecture, but no custom onnx configuration was passed as `custom_onnx_configs`. Please refer to https://huggingface.co/docs/optimum/main/en/exporters/onnx/usage_guides/export_a_model#custom-export-of-transformers-models for an example on how to export custom models. Please open an issue at https://github.com/huggingface/optimum/issues if you would like the model type qwen2_5_vl to be supported natively in the ONNX export.

I realize these are two different models, with two different errors, but if someone can point me in the direction on how to get these converted that would be awesome (or better, post a conversion to Huggingface to share with everyone).

Thank you!

Expected behavior

A runnable model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions