Course: Learning Agents (5.5)

is this warning Normal
LogSpawn: Warning: SpawnActor failed because no class was specified

Look at this too , can anyone help me resolving it

LogLearning: Display: LearningAgentsManager: Adding Agent SportsCar_Pawn_C_0 with id 31.
PIE: Server logged in
PIE: Play in editor total start time 0.289 seconds.
LogLearning: Display: PPOTrainer_0: Sending config…
LogLearning: Display: Sending config signal…
LogLearning: Display: PPOTrainer_0: Sending initial policy…
LogLearning: Display: Subprocess: Traceback (most recent call last):
LogLearning: Display: Subprocess: File “D:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Experimental\LearningAgents\Content\Python\train.py”, line 32, in
LogLearning: Display: Subprocess: module = import_module(trainer_module_name)
LogLearning: Display: Subprocess: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogLearning: Display: Subprocess: File “D:\Program Files\Epic Games\UE_5.5\Engine\Binaries\ThirdParty\Python3\Win64\Lib\importlib_init_.py”, line 126, in import_module
LogLearning: Display: Subprocess: return _bootstrap._gcd_import(name[level:], package, level)
LogLearning: Display: Subprocess: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogLearning: Display: Subprocess: File “”, line 1204, in _gcd_import
LogLearning: Display: Subprocess: File “”, line 1176, in _find_and_load
LogLearning: Display: Subprocess: File “”, line 1147, in _find_and_load_unlocked
LogLearning: Display: Subprocess: File “”, line 690, in _load_unlocked
LogLearning: Display: Subprocess: File “”, line 940, in exec_module
LogLearning: Display: Subprocess: File “”, line 241, in _call_with_frames_removed
LogLearning: Display: Subprocess: File “D:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Experimental\LearningAgents\Content\Python\train_ppo.py”, line 12, in
LogLearning: Display: Subprocess: from nne_runtime_basic_cpu_pytorch import NeuralNetwork
LogLearning: Display: Subprocess: File “D:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Experimental\LearningAgents\Content\Python/…/…/…/NNERuntimeBasicCpu/Content/Python\nne_runtime_basic_cpu_pytorch.py”, line 23, in
LogLearning: Display: Subprocess: import torch.nn as nn
LogLearning: Display: Subprocess: ModuleNotFoundError: No module named ‘torch.nn’
LogLearning: Error: PPOTrainer_0: Error sending policy to trainer: Unexpected communication received. Check log for additional errors.
LogLearning: Error: PPOTrainer_0: Training has failed. Check log for errors.
LogLearning: Error: PPOTrainer_0: Training has failed. Check log for errors.

LogLearning:Error continues

You’ll likely need to reinstall torch module, you can verify the python installation or update it. That may work, if not you will forcely need to reinstall torch which is not hard, just google it

guys my python in unreal is using the cpu versoin of torch , and i am not able to bring the python version where i have cuda version enabled to unreal .
do anyone knows how to tackle it

Did you change the PPO Trainer Setting’s Device to “GPU”?

Thank you for the reply . yes , It was due to the installation of cuda version of torch different from Unreal python editor,
i was installing it on my default python editor.

Is it possible to record the action performed by the model ,
such as the speed , steering angle , brake , acceleration.
is there any way.

Hello @Deathcalibur ,
Thank you for this Plug In and Tutorial.
I plan to edit the C++ classes such as LearningAgentsPPOTrainer to add more information sent to the python code for instance. I created a subclass MyLearningAgentsPPOTrainer to change it in MakePPOTrainer, but most of your functions in LearningAgentsPPOTrainer are not virtual and attributes are private without getters.
What would you recommend me to work on top of your plugin ?

Thank you

We don’t suggest you subclass the PPO class and instead just make a new class that inherits directly from ULearningAgentsManagerListener. You can copy the existing code as a starting place.

Wow I just found a pernicious bug which was keeping Sockets from working reliably on Mac and Linux. I made a mistake on LearningSocketTraining.cpp line 49 - FTimespan are measured in 0.1 microseconds and I thought 1.0… basically we were waiting 10x shorter than we should have been.

Can confirm that Learning Agents is working much better on Linux now!

Thanks for bringing these lines to my attention!

1 Like

Hello,

I am following the “Learning to Drive” 5.5 tutorial, but I am not sure what I did wrong here:

In this section, it says to set the PPO Class to “BP_SportsCarTrainingEnv”, that is a child of the class “LearningAgentsTrainingEnvironment”, which is not compatible with the class “Learning agents PPO Trainer” requested in the variable.

How can I fix this?

Thank you in advance.

1 Like

This was bad editing by me when I was rewriting the tutorial from 5.4 to 5.5. I’ll go make it clear.

Thanks for pointing this out!

EDIT:
This is fixed. You should set that blueprint on Make Training Environment.

1 Like

How Do I save this strings to a local text file?

You can’t easily write to text files from Blueprint and would need to write some C++ or find a plugin, as far as I know.

What are you trying to accomplish?

@Deathcalibur having the same issue that others have had above. Running Windows and UE 5.5. I have tried both solutions posted earlier, that is to say 1) Closing UE and deleting the PipInstall folder and having UE auto-install assets upon boot (tried this twice), and 2) Uninstalling and re-installing torch via cmd with my project open.

Neither have worked. Not willing to download a random dll to sys32 either (no shade, to each their own).

When should I start burning incense and praying to the project’s machine spirit? Or do you think there may be another way? Was excited to get this running.

Logfile for reference:
LogLearning: Display: Subprocess: File “C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Experimental\LearningAgents\Content\Python\train_ppo.py”, line 9, in
LogLearning: Display: Subprocess: import torch
LogLearning: Display: Subprocess: File “C:\Users[username]\OneDrive\Documents\Unreal Projects\LearningAgentsDriveB\Intermediate\PipInstall\Lib\site-packages\torch_init_.py”, line 148, in
LogLearning: Display: Subprocess: raise err
LogLearning: Display: Subprocess: OSError: [WinError 126] The specified module could not be found. Error loading “C:\Users[username]\OneDrive\Documents\Unreal Projects\LearningAgentsDriveB\Intermediate\PipInstall\Lib\site-packages\torch\lib\fbgemm.dll” or one of its dependencies.
LogLearning: Error: PPOTrainer_0: Error sending policy to trainer: Unexpected communication received. Check log for additional errors.
LogLearning: Error: PPOTrainer_0: Training has failed. Check log for errors.

That’s awesome you got it fixed! I was most likely just tweaking values and hoping for the best :smiley:

It seems like there is an issue with pytorch on various platforms. Supposedly this works but I can’t verify it:

We will resolve this with UE 5.6 by updating to a newer version of pytorch.

Brendan

Hello, @Deathcalibur

I hope this message finds you well. I’m writing to inquire about the possibility of introducing custom configuration options for neural networks in the Learning Agents plugin.

Currently, we’re able to set the number of hidden layers, the number of neurons, and the activation function during initialization. However, I often feel that these predefined options don’t fully meet my needs.

What I’m envisioning is the ability to use different activation functions within the same hidden layer.

For example:

  • In the first hidden layer, I’d like to have 5 linear neurons (which, by the way, aren’t currently available as an activation function) and 10 ReLU neurons.
  • In the second layer, I’d like 10 Tanh neurons, and so on.

In other words, I’d like the user to be able to design the neural network architecture more flexibly, tailoring it to their specific requirements.

I’m not sure if this is feasible, as my knowledge of C++ is limited, but I imagine this could be implemented as nodes in Blueprint. Users could connect these nodes sequentially, specifying parameters like:

  • Hidden layer
  • Number of neurons
  • Type of neurons (activation function)

Additionally, there would need to be input and output parameters for the current neural network, allowing users to add nodes to an existing structure.

I believe this would greatly enhance the plugin’s flexibility and open up new possibilities for experimentation. I’d be extremely grateful if such a feature could be considered for future updates.

Thank you for your time, and I look forward to hearing your thoughts!

Hey,

Sorry, we don’t support this level of customization yet in the policy backbone network. We haven’t found these sort of tweaks to be that impactful compared to spending more time considered the observations an agent needs.

We’ll consider getting to this when we can, but it’s pretty low on the priority list compared to some of the other more impactful features we have in flight.

Thanks!

I appreciate the follow-through. Attempted the specified fix and I’m still getting the same error. Assuming other pytorch dependencies. Looking forward to testing out 5.6!

Hello!
I am having some issues with tensorboard, after following the tutorial on the tensorboard page I get the “No dashboards are active for the current data set.” page.


Additionally I have this in the Unreal engine log: Subprocess: Warning: Failed to Load TensorBoard: No module named ‘tensorboard’. Please add manually to site-packages.

Am I missing something?
Just an additional note, I think you have to update the path on the tutorial from 5.4 to 5.5:

Thank you

1 Like