Releases: Unity-Technologies/ml-agents
ML-Agents Release 3
Package Versions
As part of ML-Agents Release 3, we will be versioning the different packages that make up the release.
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.1.0 |
| ml-agents (Python) | v0.17.0 |
| ml-agents-envs (Python) | v0.17.0 |
| gym-unity (Python) | v0.17.0 |
| Communicator (C#/Python) | v1.0.0 |
Major Features and Improvements
com.unity.ml-agents (C#)
ObservableAttributewas added. Adding the attribute to fields or properties on an Agent will allow it to generate observations via reflection. (#3925, #4006)
ml-agents-envs (Python)
- First version of the Unity Environment Registry (Experimental) has been released. The Environment Registry allows running pre-built Unity environments from Python without installing the Unity editor. More information here (#3967)
gym-unity (Python)
use_visualandallow_multiple_visual_obsin the UnityToGymWrapper constructor were replaced byallow_multiple_obswhich allows one or more visual observations and vector observations to be used simultaneously. (#3981) Thank you @shakenes !
ml-agents (Python)
- When using a Curriculum, the current lesson will resume if training is quit and resumed. As such, the
--lessonCLI option has been removed. (#4025) - In PPO training,
betaandepsilonnow follow the same decay schedule aslearning_rate. Previously they were always decayed. (#3940)
Example Environments
- Added new Walker environments. Improved ragdoll stability/performance. (#4037)
Breaking Changes
ml-agents
- Format for trainer configuration has changed, and the "default" behavior has been deprecated. See the Migration Guide for more details. (#3936)
- Curriculum and Parameter Randomization configurations have been merged into the main training configuration file. Note that this means training configuration files are now environment-specific. (#3791)
- Training artifacts (trained models, summaries) are now found in the
results/directory. (#3829)
--save-freqCLI option has been removed, and replaced by acheckpoint_intervaloption in the trainer configuration YAML. (#4034)
ml-agents-envs
get_behavior_names()andget_behavior_spec()on UnityEnvironment were replaced by thebehavior_specsproperty. (#3946)- In the Python API, max_step in the
TerminalStepandTerminalStepsobjects was renamedinterrupted. (#3908)
Bug Fixes and Minor Changes
ml-agents
- Unity Player logs are now written out to the results directory. (#3877)
- Run configuration YAML files are written out to the results directory at the end of the run. (#3815)
- When trying to load/resume from a checkpoint created with an earlier version of ML-Agents, a warning will be thrown. (#4035)
- Fixed an issue where SAC would perform too many model updates when resuming from a checkpoint, and too few when using
buffer_init_steps. (#4038)
Acknowledgements
Thank you @shakenes, @TPihko, and everyone at Unity for their contributions to this release.
ML-Agents Release 2
Package Versions
As part of ML-Agents Release 2, we will be versioning the different packages that make up the release.
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.0.2 |
| ml-agents (Python) | v0.16.1 |
| ml-agents-envs (Python) | v0.16.1 |
| gym-unity (Python) | v0.16.1 |
| Communicator (C#/Python) | v1.0.0 |
Bug Fixes
com.unity.ml-agents (C#)
- A bug that would cause the editor to go into a loop when a prefab was selected was fixed. (#3949)
- BrainParameters.ToProto() no longer throws an exception if none of the fields have been set. (#3930)
- The Barracuda dependency was upgraded to 0.7.1-preview. (#3977)
ml-agents / ml-agents-envs / gym-unity (Python)
- An issue was fixed where using
--initialize-fromwould resume from the past step count. (#3962) - The gym wrapper error for the wrong number of agents now fires more consistently, and more details
were added to the error message when the input dimension is wrong. (#3963) - Miscellaneous documentation fixes.
ML-Agents Release 1
Package Versions
As part of ML-Agents Release 1, we will be versioning the different packages that make up the release.
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.0.0 |
| ml-agents (Python) | v0.16.0 |
| ml-agents-envs (Python) | v0.16.0 |
| gym-unity (Python) | v0.16.0 |
| Communicator (C#/Python) | v1.0.0 |
Major Changes
com.unity.ml-agents (C#)
- The
MLAgentsC# namespace was renamed toUnity.MLAgents, and other nested namespaces were similarly renamed. (#3843) - The offset logic was removed from
DecisionRequester. (#3716) - The signature of
Agent.Heuristic()was changed to take a float array as a parameter, instead of returning the array. This was done to prevent a common source of error where users would return arrays of the wrong size. (#3765) - The communication API version has been bumped up to 1.0.0 and will use Semantic Versioning to do compatibility checks for communication between Unity and the Python process. (#3760)
- The obsolete
AgentmethodsGiveModel,Done,InitializeAgent,AgentActionandAgentResethave been removed. (#3770) - The SideChannel API has changed:
- Introduced the
SideChannelManagerto register, unregister and access side channels. (#3807) Academy.FloatPropertieswas replaced byAcademy.EnvironmentParameters. See the Migration Guide for more details on upgrading. (#3807)SideChannel.OnMessageReceivedis now a protected method (was public). (#3807)- SideChannel IncomingMessages methods now take an optional default argument, which is used when trying to read more data than the message contains. (#3751)
- Added a feature to allow sending stats from C# environments to TensorBoard (and other python StatsWriters). To do this from your code, use
Academy.Instance.StatsRecorder.Add(key, value). (#3660)
- Introduced the
CameraSensorComponent.m_GrayscaleandRenderTextureSensorComponent.m_Grayscalewere changed frompublictoprivate. These can still be accessed via their corresponding properties. (#3808)- Public fields and properties on several classes were renamed to follow Unity's C# style conventions. All public fields and properties now use "PascalCase" instead of "camelCase"; for example,
Agent.maxStepwas renamed toAgent.MaxStep. For a full list of changes, see the pull request. (#3828) WriteAdapterwas renamed toObservationWriter. If you have a customISensorimplementation, you will need to change the signature of itsWrite()method. (#3834)- The Barracuda dependency was upgraded to 0.7.0-preview (which has breaking namespace and assembly name changes). (#3875)
ml-agents / ml-agents-envs / gym-unity (Python)
- The
--loadand--traincommand-line flags have been deprecated. Training now happens by default, and use--resumeto resume training instead of--load. (#3705) - The Jupyter notebooks have been removed from the repository. (#3704)
- The multi-agent gym option was removed from the gym wrapper. For multi-agent scenarios, use the Low Level Python API. (#3681)
- The low level Python API has changed. You can look at the document Low Level Python API documentation for more information. If you use
mlagents-learnfor training, this should be a transparent change. (#3681) - Added ability to start training (initialize model weights) from a previous run ID. (#3710)
- The GhostTrainer has been extended to support asymmetric games and the asymmetric example environment Strikers Vs. Goalie has been added. (#3653)
- The
UnityEnvclass from thegym-unitypackage was renamedUnityToGymWrapperand no longer creates theUnityEnvironment. Instead, theUnityEnvironmentmust be passed as input to the constructor ofUnityToGymWrapper(#3812)
Minor Changes
com.unity.ml-agents (C#)
- Added new 3-joint Worm ragdoll environment. (#3798)
StackingSensorwas changed frominternalvisibility topublic. (#3701)- The internal event
Academy.AgentSetStatuswas renamed toAcademy.AgentPreStepand made public. (#3716) - Academy.InferenceSeed property was added. This is used to initialize the random number generator in ModelRunner, and is incremented for each ModelRunner. (#3823)
Agent.GetObservations()was added, which returns a read-only view of the observations added inCollectObservations(). (#3825)UnityRLCapabilitieswas added to help inform users when RL features are mismatched between C# and Python packages. (#3831)
ml-agents / ml-agents-envs / gym-unity (Python)
- Format of console output has changed slightly and now matches the name of the model/summary directory. (#3630, #3616)
- Renamed 'Generalization' feature to 'Environment Parameter Randomization'. (#3646)
- Timer files now contain a dictionary of metadata, including things like the package version numbers. (#3758)
- The way that UnityEnvironment decides the port was changed. If no port is specified, the behavior will depend on the
file_nameparameter. If it isNone, 5004 (the editor port) will be used; otherwise 5005 (the base environment port) will be used. (#3673) - Running
mlagents-learnwith the same--run-idtwice will no longer overwrite the existing files. (#3705) - Model updates can now happen asynchronously with environment steps for better performance. (#3690)
num_updatesandtrain_intervalfor SAC were replaced withsteps_per_update. (#3690)- The maximum compatible version of tensorflow was changed to allow tensorflow 2.1 and 2.2. This will allow use with python 3.8 using tensorflow 2.2.0rc3. (#3830)
mlagents-learnwill no longer set the width and height of the executable window to 84x84 when no width nor height arguments are given. (#3867)
Bug Fixes
com.unity.ml-agents (C#)
- Fixed a display bug when viewing Demonstration files in the inspector. The shapes of the observations in the file now display correctly. (#3771)
ml-agents / ml-agents-envs / gym-unity (Python)
- Fixed an issue where exceptions from environments provided a return code of 0. (#3680)
ML-Agents Beta 0.15.1
Bug Fixes
- Raise the wall in the CrawlerStatic scene to prevent the Agent from falling off. (#3650)
- Fixed an issue where specifying
vis_encode_typewas required only for SAC. (#3677) - Fixed the reported entropy values for continuous actions. (#3684)
- Fixed an issue where switching models using
SetModel()during training would use an excessive amount of memory. (#3664) - Environment subprocesses now close immediately on timeout or wrong API version. (#3679)
- Fixed an issue in the gym wrapper that would raise an exception if an Agent called EndEpisode multiple times in the same step. (#3700)
- Fixed an issue where logging output was not visible; logging levels are now set consistently. (#3703)
ML-Agents Beta 0.15.0
Major Changes
Agent.CollectObservationsnow takes a VectorSensor argument. (#3352, #3389)- Added
Agent.CollectDiscreteActionMasksvirtual method with aDiscreteActionMaskerargument to specify which discrete actions are unavailable to the Agent. (#3525) - We consolidated our API for
DiscreteActionMasker.SetMasktakes two arguments : the branch index and the list of masked actions for that branch. (#3525) - Beta support for ONNX export was added. If the
tf2onnxpython package is installed, models will be saved to.onnxas well as.nnformat. Note that Barracuda 0.6.0 or later is required to import the.onnxfiles properly. (#3101) - Multi-GPU training and the
--multi-gpuoption has been removed temporarily. (#3345) - All Sensor related code has been moved to the namespace
MLAgents.Sensors. (#3519) - All SideChannel related code has been moved to the namespace
MLAgents.SideChannels. (#3533) - The following methods in the
Agentclass have been deprecated and will be removed in a later release (#3557):InitializeAgent()was renamed toInitialize()AgentAction()was renamed toOnActionReceived()AgentReset()was renamed toOnEpisodeBegin()Done()was renamed toEndEpisode()GiveModel()was renamed toSetModel()
Minor Changes
- Monitor.cs was moved to Examples. (#3372)
- Automatic stepping for Academy is now controlled from the AutomaticSteppingEnabled property. (#3376)
- The GetEpisodeCount, GetStepCount, GetTotalStepCount and methods of Academy were changed to EpisodeCount, StepCount, TotalStepCount properties respectively. (#3376)
- Several classes were changed from public to internal visibility. (#3390)
- Academy.RegisterSideChannel and UnregisterSideChannel methods were added. (#3391)
- A tutorial on adding custom SideChannels was added. (#3391)
- The stepping logic for the Agent and the Academy has been simplified. (#3448)
- Update Barracuda to 0.6.1-preview. (#3584)
- The interface for
RayPerceptionSensor.PerceiveStatic()was changed to take an input class and write to an output class, and the method was renamed toPerceive(). (#3527) - The checkpoint file suffix was changed from
.cptkto.ckpt. (#3470) - The command-line argument used to determine the port that an environment will listen on was changed from
--portto--mlagents-port. (#3477) DemonstrationRecordercan now record observations outside of the editor. (#3354)DemonstrationRecordernow has an optional path for the demonstrations. This will default toApplication.dataPathif not set. (#3354)DemonstrationStorewas changed to accept aStreamfor its constructor, and was renamed toDemonstrationWriter. (#3354)- The method
GetStepCount()on the Agent class has been replaced with the property getterStepCount. (#3476) RayPerceptionSensorComponentand related classes now display the debug gizmos whenever the Agent is selected (not just Play mode). (#3484)- Most fields on
RayPerceptionSensorComponentcan now be changed while the editor is in Play mode. The exceptions to this are fields that affect the number of observations. (#3484) - Most fields on
CameraSensorComponentandRenderTextureSensorComponentwere changed to private and replaced by properties with the same name. (#3564) - Unused static methods from the
Utilitiesclass (ShiftLeft, ReplaceRange, AddRangeNoAlloc, and GetSensorFloatObservationSize) were removed. (#3495) - The
Agentclass is no longer abstract. (#3528) - SensorBase was moved out of the package and into the Examples directory. (#3528)
AgentInfo.actionMaskshas been renamed toAgentInfo.discreteActionMasks. (#3539)DecisionRequesterhas been made internal (you can still use the DecisionRequesterComponent from the inspector).RepeatActionwas renamed toTakeActionsBetweenDecisionsfor clarity. (#3555)- The
IFloatPropertiesinterface has been removed. (#3570) - Improved inference performance for models with multiple action branches. (#3598)
- The interfaces to the
SideChannelclasses (on C# and python) have changed to use newIncomingMessageandOutgoingMessageclasses. These should make reading and writing data to the channel easier. (#3596)
Bug Fixes and Improvements
- Various documentation changes and additions. (#3603, #3574, #3577, #3568, #3567, #3551, #3582)
- Fixed logging issue with SAC. (#3606)
- Fixed an issue when using GAIL with less than
batch_sizenumber of demonstrations. (#3591) - Made Unity lifecycle methods protected (
OnEnable,OnDisable). (#3590) - SideChannel messages were lost if sent before the first call to reset from Python. (#3573)
- Updated the ExpertPyramid.demo example demonstration file. (#3613)
- Updated project version for example environments to 2018.4.18f1. (#3618)
- Changed the
Product Namein the example environments to remove spaces, so that the default build executable file doesn't contain spaces. (#3612)
ML-Agents Beta 0.14.1
Bug Fixes
- Fixed an issue which caused self-play training sessions to consume a lot of memory. (#3451)
- Fixed an IndexError when using GAIL or behavioral cloning with demonstrations recorded with 0.14.0 or later (#3464)
- Updated the
gail_config.yamlto work with per-Agent steps (#3475) - Fixed demonstration recording of experiences when the Agent is done. (#3463)
- Fixed a bug with the rewards of multiple Agents in the gym interface (#3471, #3496)
ML-Agents Beta 0.14.0
Major Changes
- A new self-play mechanism for training agents in adversarial scenarios was added (#3194)
- Tennis and Soccer environments were refactored to enable training with self-play (#3194, #3331)
- UnitySDK folder was split into a Unity Package (com.unity.ml-agents) and our examples were moved to the Project folder (#3267)
- Academy is now a singleton and is no longer abstract (#3210, #3184)
- In order to reduce the size of the API, several classes and methods were marked as internal or private.
- Some public fields on the Agent were trimmed (#3342, #3353, #3269)
- Decision Period and on-demand decision checkboxes were removed from the Agent. on-demand decision is now the default (#3243)
- Calling Done() on the Agent will reset it immediately and call the AgentReset virtual method (#3291, #3242)
- The "Reset on Done" setting in AgentParameters was removed; this is now always true. AgentOnDone virtual method on the Agent was removed (#3311, #3222)
- Trainer steps are now counted per-Agent, not per-environment as in previous versions. For instance, if you have 10 Agents in the scene, 20 environment steps now correspond to 200 steps as printed in the terminal and in Tensorboard (#3113)
Minor Changes
- Barracuda was updated to 0.5.0-preview (#3329)
--num-runsoption was removed from mlagents-learn (#3155)- Curriculum config files are now YAML formatted and all curricula for a training run are combined into a single file (#3186)
- ML-Agents components, such as BehaviorParameters and various Sensor implementations, now appear in the Components menu (#3231)
- Exceptions are now raised in Unity (in debug mode only) if NaN observations or rewards are passed (#3221)
- RayPerception MonoBehavior, which was previously deprecated, was removed (#3304)
- Uncompressed visual (i.e. 3d float arrays) observations are now supported. CameraSensorComponent and RenderTextureSensor now have an option to write uncompressed observations (#3148)
- Agent’s handling of observations during training was improved so that an extra copy of the observations is - no longer maintained (#3229)
- Error message for missing trainer config files was improved to include the absolute path (#3230)
- Support for 2017.4 LTS was dropped (#3121, #3168)
- Some documentation improvements were made (#3296, #3292, #3295, #3281)
Bug Fixes
- Numpy warning when stats don’t exist (#3251)
- A bug that caused RayPerceptionSensor to behave inconsistently with transforms that have non-1 scale was fixed (#3321)
- Some small bugfixes to tensorflow_to_barracuda.py were backported from the barracuda release (#3341)
- Base port in the jupyter notebook example was updated to use the same port that the editor uses (#3283)
ML-Agents Beta 0.13.1
ML-Agents Beta 0.13.0
Major Changes
- The low level Python API has changed (#3022). See the Low Level Python API documentation for more information.
- Parameters such as resolution and time scale are no longer configured in the Academy; these are now passed on the mlagents-learn command line. See the Migration Guide for more details. (#2956)
- Offline Behavioral Cloning training was removed. To learn from demonstrations, use the GAIL and Behavioral Cloning features with either PPO or SAC (#2969)
- Agents can now use sensors of child GameObjects as observations (#3095)
- The RayPerceptionSensor now supports a layerMask option that is used in raycasting. (#3111 )
- The official minimum version of Unity supported by ML-Agents is now 2018.4 LTS.
For instructions on how to migrate from 0.12.0 to 0.13.0 see the Migration Guide.
Minor Fixes and Improvements
- A separation of statistics collection from the trainer with the StatsReporter and StatsWriter classes (#3076, #3108)
- mlagents.envs was renamed to mlagents_envs
- A new AgentProcessor class and Trajectory abstraction is now live. Trainers now ingest trajectories which are assembled by the AgentProcessor. (#3067)
- A bug that could cause the Academy to call a disabled agent’s _AgentReset() method is fixed (#3072)
- Better error handling when the trainer configuration doesn’t contain a “default” entry (#3063)
- Better error handling when there is a mismatch between the metacurriculum configuration and brains being trained (#3034)
- A bug that prevented agents with different decision intervals from learning in the same scene is fixed (#3181)
ML-Agents Beta 0.12.1
Fixes & Performance Improvements
- Fixed bug that could degrade training for recurrent networks (#3066). If you are on 0.12.0 and using LSTMs to train your agents, we recommend you upgrade to 0.12.1 and retrain your model.
- Fixed bug in the environment setup in a Jupyter notebook (#3068)
- Added extra logging on API versions in port numbers, to help debugging connection issues (#3069)
- Minor documentation fixes (#3070)