Loading pre-trained model using Python API

Hello everyone,

I trained an agent using mlagents-learn. I visualized how it’s doing post-training via “inference” mode. However, this was done via command line. I want to be able to use the python API to load in my pre-trained model and do some other stuff with it like collect trajectories for agent.

I am somewhat familiar with “UnityEnvironment” class but only used it to load in environments with fresh agents not pre-trained. How do I go about loading a pre-trained model in my python script?

I wasn’t able to find pertinent information in the ml-agents python API docs. Would someone be able to point me in the right direction?

Thanks in advance!

Models trained using their learn command can be run on python. There are showcase projects in the showcase thread that did manage to do this.

I think you have to look up how to run the .nn onyx files in python.