Closed SetoKaiba closed 2 days ago
Hi @SetoKaiba, It's not possible, afaik.
The ScriptedImporter throws an error like the one below when there is a conflict with the extension.
Multiple scripted importers are targeting the extension 'onnx' and have all been rejected: Unity.Sentis.ONNXModelImporter (assembly: /onnxruntime-unity-examples/Library/ScriptAssemblies/Unity.Sentis.ONNX.dll), Microsoft.ML.OnnxRuntime.Unity.Editor.OrtImporter (assembly: /onnxruntime-unity-examples/Library/ScriptAssemblies/com.github.asus4.onnxruntime.unity.Editor.dll)
UnityEditor.AssetImporters.ScriptedImporter:RegisterScriptedImporters () (at /Users/bokken/build/output/unity/unity/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:112)
Here's some workaround to read onnx with Sentis:
onnx
to bytes
. The model is imported as raw binary data. And OnnxRuntime.InferenceSession can load it. https://discussions.unity.com/t/multiple-glb-importers-how-do-i-fix-this/900888
What about make it an optional scripted importer?
Thanks @SetoKaiba.
I didn't know it. It worked with Sentis.
Environment (please complete the following information):
Describe the bug Onnx importing should be allowed with Sentis installed. Due to #26 , onnx is not allowed imported. But platform we may prefer onnxruntime. For example for low end Android XR glasses, Sentis doesn't allow the model totally run in background thread. Only nn is run by job in background thread. In such case, onnxruntime is preferred.
To Reproduce Not related
Expected behavior Onnx importing should be allowed with Sentis installed.
Screenshots Not related
Additional context Not related