Problems with OpenVino Export #3159
-
|
Hi guys, im currently working on a anomaly detection application for my bachelorthesis. Im having trouble exporting my trained EfficientAD model to openvino. In the following you can see my export script and the generated failure message. I'm using Python 3.11.9 and installed all the imports with pip install "anomalib[openvino]", pip install requests, pip install onnxscript Code: engine = Engine() ckpt_path=r"C:\Users\ukusp003\Desktop\bachelorarbeit\5_Code\image_learning\image_anomaly_detection\anomalib_framework\checkpoints\EfficientAD_dataset_L_NO_SSR_1DB_20251127-152914\EfficientAD_dataset_L_NO_SSR_1DB_20251127-152914_epoch=29.ckpt" exported_paths=engine.export(model=model, print(f"Export finsihed: {exported_paths}") Errormsg:ValueError Traceback (most recent call last) File c:\Users\ukusp003\Desktop\bachelorarbeit\5_Code.venv_ANOMALIB\Lib\site-packages\torch\onnx_internal\exporter_dynamic_shapes.py:95, in from_dynamic_axes_to_dynamic_shapes(model, args, kwargs, dynamic_axes, output_names, input_names) File c:\Users\ukusp003\Desktop\bachelorarbeit\5_Code.venv_ANOMALIB\Lib\site-packages\torch\onnx_internal\exporter_dynamic_shapes.py:307, in _unflatten_dynamic_shapes_with_inputs_tree(inputs, dynamic_shapes) RuntimeError: # Failed to convert 'dynamic_axes' to 'dynamic_shapes'. Please provide 'dynamic_shapes' directly. Refer to the documentation for 'torch.export.export' for more information on dynamic shapes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi @phillipkusinski |
Beta Was this translation helpful? Give feedback.


Hi @phillipkusinski
This is because in
torch.onnx.export(),dynamois changed toTrueby default in torch 2.9.Can you switch to Torch 2.8 and see if it solves?
I have a fix for this in #3155 - here.