ML-Agents Release 13
Package Versions
NOTE: It is strongly recommended that you use packages from the same release together for the best experience.
| Package | Version |
|---|---|
| com.unity.ml-agents (C#) | v1.8.0 |
| com.unity.ml-agents.extensions (C#) | v0.1.0-preview |
| ml-agents (Python) | v0.24.0 |
| ml-agents-envs (Python) | v0.24.0 |
| gym-unity (Python) | v0.24.0 |
| Communicator (C#/Python) | v1.4.0 |
Major Features and Improvements
com.unity.ml-agents / com.unity.ml-agents.extensions
- Add an InputActuatorComponent to allow the generation of Agent action spaces from an InputActionAsset.
Projects wanting to use this feature will need to add the
Input System Package at version 1.1.0-preview.3 or later. (#4881)
ml-agents / ml-agents-envs / gym-unity (Python)
- TensorFlow trainers have been removed, please use the Torch trainers instead. (#4707)
- A plugin system for
mlagents-learnhas been added. You can now define custom
StatsWriterimplementations and register them to be called during training.
More types of plugins will be added in the future. (#4788)
Minor Changes
com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
- The
ActionSpecconstructor is now public. Previously, it was not possible to create an
ActionSpec with both continuous and discrete actions from code. (#4896) StatAggregationMethod.Sumcan now be passed toStatsRecorder.Add(). This
will result in the values being summed (instead of averaged) when written to
TensorBoard. Thanks to @brccabral for the contribution! (#4816)- The upper limit for the time scale (by setting the
--time-scaleparameter in mlagents-learn) was
removed when training with a player. The Editor still requires it to be clamped to 100. (#4867) - Added the IHeuristicProvider interface to allow IActuators as well as Agent implement the Heuristic function to generate actions.
Updated the Basic example and the Match3 Example to use Actuators.
Changed the namespace and file names of classes in com.unity.ml-agents.extensions. (#4849) - Added
VectorSensor.AddObservation(IList<float>).VectorSensor.AddObservation(IEnumerable<float>)
is deprecated. TheIListversion is recommended, as it does not generate any
additional memory allocations. (#4887) - Added
ObservationWriter.AddList()and deprecatedObservationWriter.AddRange().
AddList()is recommended, as it does not generate any additional memory allocations. (#4887) - The Barracuda dependency was upgraded to 1.3.0. (#4898)
- Added
ActuatorComponent.CreateActuators, and deprecatedActuatorComponent.CreateActuator. The
default implementation will wrapActuatorComponent.CreateActuatorin an array and return that. (#4899) InferenceDevice.Burstwas added, indicating that Agent's model will be run using Barracuda's Burst backend.
This is the default for new Agents, but existing ones that useInferenceDevice.CPUshould update to
InferenceDevice.Burst. (#4925)
ml-agents / ml-agents-envs / gym-unity (Python)
- Tensorboard now logs the Environment Reward as both a scalar and a histogram. (#4878)
- Added a
--torch-devicecommandline option tomlagents-learn, which sets the default
torch.deviceused for training. (#4888) - The
--cpucommandline option had no effect and was removed. Use--torch-device=cputo force CPU training. (#4888) - The
mlagents_envAPI has changed,BehaviorSpecnow has aobservation_specsproperty containing a list ofObservationSpec. For more information onObservationSpecsee here. (#4763, #4825)
Bug Fixes
com.unity.ml-agents (C#)
- Fix a compile warning about using an obsolete enum in
GrpcExtensions.cs. (#4812) - CameraSensor now logs an error if the GraphicsDevice is null. (#4880)
- Removed unnecessary memory allocations in
ActuatorManager.UpdateActionArray()(#4877) - Removed unnecessary memory allocations in
SensorShapeValidator.ValidateSensors()(#4879) - Removed unnecessary memory allocations in
SideChannelManager.GetSideChannelMessage()(#4886) - Removed several memory allocations that happened during inference. On a test scene, this
reduced the amount of memory allocated by approximately 25%. (#4887) - Removed several memory allocations that happened during inference with discrete actions. (#4922)
- Properly catch permission errors when writing timer files. (#4921)
- Unexpected exceptions during training initialization and shutdown are now logged. If you see
"noisy" logs, please let us know! (#4930, #4935)
ml-agents / ml-agents-envs / gym-unity (Python)
- Fixed a bug that would cause an exception when
RunOptionswas deserialized viapickle. (#4842) - Fixed a bug that can cause a crash if a behavior can appear during training in multi-environment training. (#4872)
- Fixed the computation of entropy for continuous actions. (#4869)
- Fixed a bug that would cause
UnityEnvironmentto wait the full timeout
period and report a misleading error message if the executable crashed
without closing the connection. It now periodically checks the process status
while waiting for a connection, and raises a better error message if it crashes. (#4880) - Passing a
-logfileoption in the--env-argsoption tomlagents-learnis
no longer overwritten. (#4880) - The
load_weightsfunction was being called unnecessarily often in the Ghost Trainer leading to training slowdowns. (#4934)