Unity-Technologies / barracuda-release

Other
564 stars 76 forks source link

OnnxImportException: Unknown type BatchedNMS_TRT encountered while parsing layer nms_num_detections. #299

Closed kaustubh726 closed 1 year ago

kaustubh726 commented 1 year ago

I have trained a yolo model in pytorch. Also there is non max suppression layer at the end. I am trying to export the model in onnx format so that I can get inference in the unity using barracuda. But I am getting the following error during asset import.

Asset import failed, OnnxImportException: Unknown type BatchedNMS_TRT encountered while parsing layer nms_num_detections.

Unity.Barracuda.ONNX.ONNXModelConverter.Err (Unity.Barracuda.Model model, System.String layerName, System.String message, System.String extendedMessage, System.String debugMessage) (at Library/PackageCache/com.unity.barracuda@80909e3320/Barracuda/Runtime/ONNX/ONNXModelConverter.cs:3434) Unity.Barracuda.ONNX.ONNXModelConverter.ConvertOnnxModel (Onnx.ModelProto onnxModel) (at Library/PackageCache/com.unity.barracuda@80909e3320/Barracuda/Runtime/ONNX/ONNXModelConverter.cs:2954) Unity.Barracuda.ONNX.ONNXModelConverter.Convert (Google.Protobuf.CodedInputStream inputStream) (at Library/PackageCache/com.unity.barracuda@80909e3320/Barracuda/Runtime/ONNX/ONNXModelConverter.cs:170) Unity.Barracuda.ONNX.ONNXModelConverter.Convert (System.String filePath) (at Library/PackageCache/com.unity.barracuda@80909e3320/Barracuda/Runtime/ONNX/ONNXModelConverter.cs:98) Unity.Barracuda.ONNXModelImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at Library/PackageCache/com.unity.barracuda@80909e3320/Barracuda/Editor/ONNXModelImporter.cs:65) UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at /Users/bokken/buildslave/unity/build/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:22)

Aurimasp commented 1 year ago

Hey, we have added support for NMS and it should be working in the upcoming new Barracuda version.