hi,
I could train My agent using PPO and I got onnx and pt Model files.
I wonder how can I inference a specific trained model? not only about the latest model.
In my case, I could not use Unity editor.
so… I wonder inference trained models in python script or CLI command
I already tried using ‘mlagents-learn --env=env --resume --run-id=run-id --inference’ but I was not able to understand which model is loaded…
could you tell me about the solution for me…
Hi,
Resume will load the latest model the resulted from training. We currently do not support using another model for loading. Maybe you could try renaming the checkpoint you want to use to checkpoint.pt so it is the one mlagents-learn will use.
Why can’t you use the editor for inference? What is your use case?
1 Like
In my case, I just used building files that export Unity, not all unity script files. Environment was made by other people.
so, Environment is able to connect mlagents-learn or in python scripts.
can load ONNX or pt file in python script for inference?
If you want to do inference with Python not with the latest model, we do not have an official way of supporting this. But you should be able to take any .pt file, and rename it to checkpoint.pt. I think this is the name of the .pt file that the trainer will look for when resuming.