- Home /
Why does my android build not run or load the neural network I've used in my android game?
I'm trying to run a neural network in an android game on unity. It is a light-weight mobilenet .onnx model. When I run it in game mode on the unity engine it works perfectly, but when I build and run it on my android device the neural network part of it doesn't seem to exist.
What I'm trying to do is use the output of the neural network to set the position of a cube in the scene. In game-mode, this works well. When building and running on my phone, the cube stays in its default position.
I'm using Barracuda for the model execution.
Has anyone else faced this issue? Would appreciate any help.
Perhaps the data is being filtered out when you build because it's not obviously being used anywhere?
For example, if you haven't explicitly assigned something in your project to a GameObject's Component(s) in any scene, they may be filtered out as "unnecessary" to the final build(s) unless you ensure they're in placed in a Resources folder.
Thank you for your reply. I understand. I've attached my neural net to a $$anonymous$$onobehavior in a gameobject as shown in the picture. Is this not enough to tell unity that it is being used?
I also tried loading it through a resources folder but I faced the same issue
same issue.did you found the solution??
Answer by xYuye · Sep 25, 2020 at 09:59 AM
I am using the same software to load Pytorch' ResNet18 with a .onnx file. Works fine in editor, app crashes in android.
Your answer
Follow this Question
Related Questions
The type or namespace name 'NetworkSystem' does not exist in the namespace 'UnityEngine.Networking' 1 Answer
Unity android Unable to forward network traffic to device 7 Answers
How can add Android 6.0 on my API Level ( I have all my sdk installed up until Android 7.0 Nougat) 1 Answer
Android build failed error 1 Answer
Multiplayer Tutorial android problem 0 Answers