MakiKK
July 9, 2020, 10:28am
1
I made tiny yolo model file by “keras-yolo2 ” (“Tiny Yolo” mode) and converted .h5 to .onnx by “keras2onnx ”.
Then I import model file in Unity, An error occurred.
“OnnxLayerImportException: Only tensors of rank 4 or less are supported, but got rank 6”
Is there a way to use this model? Is “keras-yolo2” or “keras2onnx” unusable?
Used: Unity 2019.4.2f1
All error message:
OnnxLayerImportException: Only tensors of rank 4 or less are supported, but got rank 6
Unity.Barracuda.ONNXLayout.AxisPermutationsForMappingONNXLayoutToBarracuda (System.Int32 onnxRank, System.String onnxLayout) (at Library/PackageCache/com.unity.barracuda@1.0.1/Barracuda/Editor/ONNXLayout.cs:44)
Unity.Barracuda.ONNXLayout.PermuteToBarracuda (System.Int64[ ] shape, System.String onnxLayout) (at Library/PackageCache/com.unity.barracuda@1.0.1/Barracuda/Editor/ONNXLayout.cs:158)
Unity.Barracuda.ONNXLayout.ConvertSymbolicShapeToBarracuda (System.Int64[ ] onnxShape, System.String onnxLayout) (at Library/PackageCache/com.unity.barracuda@1.0.1/Barracuda/Editor/ONNXLayout.cs:223)
Unity.Barracuda.ONNXLayout.ConvertSymbolicShapeToBarracuda (Onnx.TensorShapeProto shape, System.String onnxLayout) (at Library/PackageCache/com.unity.barracuda@1.0.1/Barracuda/Editor/ONNXLayout.cs:218)
Unity.Barracuda.ONNXModelImporter.ConvertOnnxModel (Onnx.ModelProto onnxModel) (at Library/PackageCache/com.unity.barracuda@1.0.1/Barracuda/Editor/ONNXModelImporter.cs:1049)
Unity.Barracuda.ONNXModelImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at Library/PackageCache/com.unity.barracuda@1.0.1/Barracuda/Editor/ONNXModelImporter.cs:1005)
UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at /Users/builduser/buildslave/unity/build/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:22)
UnityEditor.Experimental.AssetImporters.AssetImporterEditor:ApplyRevertGUI()
Unity.Barracuda.ONNXModelImporterEditor:OnInspectorGUI() (at Library/PackageCache/com.unity.barracuda@1.0.1/Barracuda/Editor/ONNXModelImporterEditor.cs:35)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)
For Barracuda problems with models that weren’t generated by ML-Agents, please ask on the Barracuda github issues page: Issues · Unity-Technologies/barracuda-release · GitHub
MakiKK
July 10, 2020, 9:18am
3
Thank you for your reply.
There was a similar case on that page, so I will try it while looking at it.
Please I face the same issue, did you solve it