Search Unity

InvalidProtocolBufferException when I add onnx model

Discussion in 'Barracuda' started by unity-huunity, May 27, 2020.

  1. unity-huunity

    unity-huunity

    Joined:
    Dec 17, 2013
    Posts:
    10
    When I add onnx model to my project unity shows an error:

    So I can't add onnx model as NNModel field in unity inspector. Any ideas? What should I do?
    I'm trying to follow this guide
     
  2. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Most likely your your onnx file is broken. Could you please post it here?
     
  3. unity-huunity

    unity-huunity

    Joined:
    Dec 17, 2013
    Posts:
    10
    I've take onnx file from here
     
  4. unity-huunity

    unity-huunity

    Joined:
    Dec 17, 2013
    Posts:
    10
    ok, i figured it out.
    It was wrong version of onnx model format.

    if you have same problem:
    1. go to barakuda github
    2. go to barracuda-release/Tools/requirements.txt
    3. there is a line with onnx version requirement
    4. find model with version you need
     
    Last edited: May 28, 2020
  5. JanNiklasEngel

    JanNiklasEngel

    Joined:
    Oct 31, 2020
    Posts:
    1
    Having the same problem. Does step 4 mean that the model was created with the same onnx version as used by the current barracuda release (from requirements.txt)?

    This is a really frustrating issue. Trying to get the asset import working for 2 days now.
     
  6. alexandreribard_unity

    alexandreribard_unity

    Unity Technologies

    Joined:
    Sep 18, 2019
    Posts:
    53
    If you are getting a error in `Google.Protobuf` the problem is most likely that your onnx model is corrupted.
    Try loading it in onnxruntime to see if it complains.
    If you manage to load it in onnxruntime, we might have a problem on our end