I trained a neural network using ML-Agents. Training completely perfectly on PyTorch side, but when I tried to make inference using the .onnx created, Barracuda gives me a whole list of error.
I have attached the onnx file in this question. Adding it into Editor already produces error (Cannot reshape array of size…). Running inference with the onnx file in game mode also produces error (Off-axis dimensions must match).
My agent uses 2 Buffer Sensors, 1 Grid Sensor (with resnet and 6-channel input), and vector observations. Did some investigation and tried one version with Buffer Sensors only, one version with Grid Sensors only, both managed to run inferences with no errors. It’s when they are combined that the error arises.
Not sure if this is a Barracuda or ML-Agents (or both) problem. I posted a more detailed version of this question on Barracuda’s forum.
I am using:
ML-Agents Release 18 (uses Barracuda 2.0.0)
PyTorch 1.7.1
Unity Version 2019.4.1f1
Windows 10 OS
@WaxyMcRivers , I installed ML-Agents from the package manager. Below are screenshots of ML-Agents and Barracuda versioning from Unity package manager:
Barracuda 2.0.0 is being used, this should be the correct version that ML-Agents release 18 uses according to the versioning page in ML-Agents Git Repo.
I upgraded my project’s Barracuda version to 2.1.0-preview. My quick test show that errors no longer appear when the onnx file is add to editor. Also, errors no longer appear when running inference in game mode. I’ll test it more thoroughly for sure.
If any creators of ML-Agents is looking at this thread, suggest that further releases be updated to use Barracuda 2.1.0.