Can I use the nnmodel by code when initialize an object? The drag way is not applicable to objects that created in runing time.
HI @smartriver97 ,
There’s an example of this here: ml-agents/Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ModelOverrider.cs at 7edf429d09224006c27715bef1ea6011fb7b1594 · Unity-Technologies/ml-agents · GitHub
I wouldn’t recommend using the whole class, because it quits the program after a certain number of episodes, but the loading code should work in general.
Note that this approach currently only works for .nn files, not .onnx files (onnx goes through a separate import path that depends on private methods).
Thanks,I would have a try