Skip to content

'InvalidProtocolBufferException' occurs when importing Tiny-YOLO v2 assets #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kazuhito00 opened this issue Feb 11, 2021 · 3 comments
Closed

Comments

@Kazuhito00
Copy link

Hello. Thank you for the wonderful project.

I tried to import Tiny-YOLO v2 into Unity under the following conditions:
 Model : tinyyolov2-7.onnx(ONNX Model Zoo)
 OS : Windows 10
 Unity version : 2017.4.25f1 (64-bit)
 Barracuda version : 1.3.0

At that time, I received the following message and failed.
image

I think Barracuda supports "Tiny-YOLO v2".
Did I make a mistake in building my environment?

The error message is:

InvalidProtocolBufferException: Protocol message contained a tag with an invalid wire type.
Google.Protobuf.UnknownFieldSet.MergeFieldFrom (Google.Protobuf.CodedInputStream input) (at T:/src/github/protobuf/csharp/src/Google.Protobuf/UnknownFieldSet.cs:232)
Google.Protobuf.UnknownFieldSet.MergeFieldFrom (Google.Protobuf.CodedInputStream input) (at T:/src/github/protobuf/csharp/src/Google.Protobuf/UnknownFieldSet.cs:222)
Google.Protobuf.UnknownFieldSet.MergeFieldFrom (Google.Protobuf.UnknownFieldSet unknownFields, Google.Protobuf.CodedInputStream input) (at T:/src/github/protobuf/csharp/src/Google.Protobuf/UnknownFieldSet.cs:257)
Onnx.ModelProto.MergeFrom (Google.Protobuf.CodedInputStream input) (at Library/PackageCache/com.unity.barracuda@fd3de8935d/Barracuda/Runtime/ONNX/Generated/Onnx.cs:1645)
Unity.Barracuda.ONNX.ONNXModelConverter.Convert (Google.Protobuf.CodedInputStream inputStream) (at Library/PackageCache/com.unity.barracuda@fd3de8935d/Barracuda/Runtime/ONNX/ONNXModelConverter.cs:100)
Unity.Barracuda.ONNX.ONNXModelConverter.Convert (System.String filePath) (at Library/PackageCache/com.unity.barracuda@fd3de8935d/Barracuda/Runtime/ONNX/ONNXModelConverter.cs:83)
Unity.Barracuda.ONNXModelImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at Library/PackageCache/com.unity.barracuda@fd3de8935d/Barracuda/Editor/ONNXModelImporter.cs:58)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at :0)
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

@AlexRibard
Copy link
Collaborator

AlexRibard commented Feb 11, 2021

We do import onnx tiny-yolov2-7 zoo model.
This crashes in google's protobuf importer. My guess is that the model is corrupted.
I wouldn't be surprised that it doesn't load in onnxruntime aswell

I would re-download the whole model and try again.
https://github.com/onnx/models/raw/master/vision/object_detection_segmentation/tiny-yolov2/model/tinyyolov2-7.tar.gz
You can download the model here.

@Kazuhito00
Copy link
Author

Thank you very much.
I was able to import the model downloaded from this link.
https://github.com/onnx/models/raw/master/vision/object_detection_segmentation/tiny-yolov2/model/tinyyolov2-7.tar.gz

Comparing the model sizes, I think it was damaged because there was a slight difference.

@romygt
Copy link

romygt commented May 14, 2023

I have the same problem, @Kazuhito00 @AlexRibard could you please send me the onnx model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants