The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
I am experiencing a bug, that when I have finished training my model and I want to use it then, I put the model into the Model Field in Unity. I do this for 16 Agents in a single environment. The first run there are no problems. Then I stop the run and change all models except for one to "Inference only" (the first run was "Default") and the one remaining agent to "Heuristic only", as I want to play myself against the other agents.
Then I get the warning:
"Found unreferenced, but undisposed BurstTensorData that potentially participates in an unfinished job and might lead to hazardous memory overwrites
UnityEngine.Debug:LogWarning (object)
Unity.Sentis.D:LogWarning (object) (at ./Library/PackageCache/com.unity.sentis@1.2.0-exp.2/Runtime/Core/Internals/Debug.cs:72)
Unity.Sentis.BurstTensorData:Finalize () (at ./Library/PackageCache/com.unity.sentis@1.2.0-exp.2/Runtime/Core/Backends/CPU/BurstTensorData.cs:145)".
When I then change all the agents back to "Default" as in the first run, the warning still occurs. I have looked for solutions for a long time on the Internet, but there is only one solution, where I do not understand where in the code I need to change something
( https://github.com/AlexRibard/Barracuda-U-2-NetTest/issues/3 ).
To reproduce this error you need to follow these simple steps:
open up the default PushBlock environment provided by mlagents
hit run once and then everything should run as desired with the provided model asset
stop running and change only the agent of the first environment to "heuristic only"
hit run again and then there should be the warning in the console
Edit: You can simply hit run then stop and then run again, I just found out
Edit2: It does only happen in release 21 (3.0.0) and not in release 20 (2.3.0)
I am not really sure, whether I tested this excact scenario with Torch-CPU before, but right now I am using Torch-CUDA 12.1 with torch version 2.3.0.
My other specs:
I am experiencing a bug, that when I have finished training my model and I want to use it then, I put the model into the Model Field in Unity. I do this for 16 Agents in a single environment. The first run there are no problems. Then I stop the run and change all models except for one to "Inference only" (the first run was "Default") and the one remaining agent to "Heuristic only", as I want to play myself against the other agents. Then I get the warning:
"Found unreferenced, but undisposed BurstTensorData that potentially participates in an unfinished job and might lead to hazardous memory overwrites UnityEngine.Debug:LogWarning (object) Unity.Sentis.D:LogWarning (object) (at ./Library/PackageCache/com.unity.sentis@1.2.0-exp.2/Runtime/Core/Internals/Debug.cs:72) Unity.Sentis.BurstTensorData:Finalize () (at ./Library/PackageCache/com.unity.sentis@1.2.0-exp.2/Runtime/Core/Backends/CPU/BurstTensorData.cs:145)".
When I then change all the agents back to "Default" as in the first run, the warning still occurs. I have looked for solutions for a long time on the Internet, but there is only one solution, where I do not understand where in the code I need to change something ( https://github.com/AlexRibard/Barracuda-U-2-NetTest/issues/3 ).
To reproduce this error you need to follow these simple steps:
Edit: You can simply hit run then stop and then run again, I just found out Edit2: It does only happen in release 21 (3.0.0) and not in release 20 (2.3.0)
I am not really sure, whether I tested this excact scenario with Torch-CPU before, but right now I am using Torch-CUDA 12.1 with torch version 2.3.0. My other specs: