Setting Up Inference

This guide will explain how to use your trained RL agents in inference mode (i.e. without connecting to Python).

Note

This guide assumes you have already done a training run using Schola and have either a saved checkpoint have already exported the model to Onnx.

Convert a Checkpoint to Onnx

If you did not export to onnx during training you will need to convert a checkpoint to Onnx, you can use the following scripts to create an Onnx model from your checkpoint:

Copied!

python -m ./Resources/python/scripts/sb3/sb3-to-onnx.py --model-path <CHECKPOINT_PATH> --output-path <ONNX_PATH>

These commands will create an Onnx model in a standardized format compatible with Schola that can be used in the next section.

Load an Onnx Model into Unreal Engine

Once you have your Onnx model you can import it into Unreal Engine by dragging and dropping the .onnx file into the content browser. This will create a new Onnx model data asset in your project.

Creating an Inference Agent

In Schola an inference agent is any object implementing the Agent Interface. However, we also provide three default implementations to help get the user started InferenceComponent, InferencePawn, and InferenceController. Follow the instructions below to prepare an actor or pawn to be controlled by your trained policy.

To use the Inference Component, add a UInferenceComponent to any actor you want to control with your trained policy.

Once you’ve created your Inference Agent, go to the Reinforcement Learning tab of the details panel and set the Onnx model Property under Policy to the Data Asset created when you imported your onnx model into unreal.

Related pages

  • Visit the Schola product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!