From 86f63d9b60e8ea02a3bee301a8ec87e5f77f5f58 Mon Sep 17 00:00:00 2001 From: Jonathan Harper Date: Mon, 28 Oct 2019 16:50:49 -0700 Subject: [PATCH 1/8] Update package and communicator versions to 0.11 --- UnitySDK/Assets/ML-Agents/Scripts/Academy.cs | 2 +- gym-unity/setup.py | 2 +- ml-agents-envs/mlagents/envs/environment.py | 2 +- ml-agents-envs/setup.py | 2 +- ml-agents/setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UnitySDK/Assets/ML-Agents/Scripts/Academy.cs b/UnitySDK/Assets/ML-Agents/Scripts/Academy.cs index dffd744525..973cb94d3a 100644 --- a/UnitySDK/Assets/ML-Agents/Scripts/Academy.cs +++ b/UnitySDK/Assets/ML-Agents/Scripts/Academy.cs @@ -92,7 +92,7 @@ public EnvironmentConfiguration( "docs/Learning-Environment-Design-Academy.md")] public abstract class Academy : MonoBehaviour { - private const string k_ApiVersion = "API-10"; + private const string k_ApiVersion = "API-11"; /// Temporary storage for global gravity value /// Used to restore oringal value when deriving Academy modifies it diff --git a/gym-unity/setup.py b/gym-unity/setup.py index 9d2167ac80..f724e0dae8 100755 --- a/gym-unity/setup.py +++ b/gym-unity/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages from setuptools.command.install import install -VERSION = "0.11.0.dev0" +VERSION = "0.11.0" class VerifyVersionCommand(install): diff --git a/ml-agents-envs/mlagents/envs/environment.py b/ml-agents-envs/mlagents/envs/environment.py index 07ef4f78e6..197b70bfe2 100644 --- a/ml-agents-envs/mlagents/envs/environment.py +++ b/ml-agents-envs/mlagents/envs/environment.py @@ -72,7 +72,7 @@ def __init__( atexit.register(self._close) self.port = base_port + worker_id self._buffer_size = 12000 - self._version_ = "API-10" + self._version_ = "API-11" self._loaded = ( False ) # If true, this means the environment was successfully loaded diff --git a/ml-agents-envs/setup.py b/ml-agents-envs/setup.py index 126c0b2e22..f2021aee65 100644 --- a/ml-agents-envs/setup.py +++ b/ml-agents-envs/setup.py @@ -3,7 +3,7 @@ from setuptools import setup from setuptools.command.install import install -VERSION = "0.11.0.dev0" +VERSION = "0.11.0" here = os.path.abspath(os.path.dirname(__file__)) diff --git a/ml-agents/setup.py b/ml-agents/setup.py index 34be08447d..5211612ee4 100644 --- a/ml-agents/setup.py +++ b/ml-agents/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_namespace_packages from setuptools.command.install import install -VERSION = "0.11.0.dev0" +VERSION = "0.11.0" here = os.path.abspath(os.path.dirname(__file__)) From a941c503da4b13d9afb6deadbe58661d1aaf5f76 Mon Sep 17 00:00:00 2001 From: Jonathan Harper Date: Mon, 28 Oct 2019 16:55:40 -0700 Subject: [PATCH 2/8] Remove pip cache fallback for CircleCI This change removes the caching fallback in the case where dependencies change, since it can cause CI failures when we have incompatible dependencies in the cache. --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1fd69cfb3..a554cfb8ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,8 +33,6 @@ jobs: keys: # Parameterize the cache so that different python versions can get different versions of the packages - v1-dependencies-py<< parameters.pyversion >>-{{ checksum "python_deps.txt" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies-py<< parameters.pyversion >>- - run: name: Install Dependencies From f6861e6c448f8b4a6ea8c850aa05490407c83bde Mon Sep 17 00:00:00 2001 From: Jonathan Harper Date: Mon, 28 Oct 2019 17:03:42 -0700 Subject: [PATCH 3/8] Limit Tensorflow version for tests to <2.0 --- test_constraints_max_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_constraints_max_version.txt b/test_constraints_max_version.txt index a4326315e6..9d8f6832b9 100644 --- a/test_constraints_max_version.txt +++ b/test_constraints_max_version.txt @@ -2,4 +2,4 @@ # For projects with upper bounds, we should periodically update this list to the latest release version grpcio>=1.23.0 numpy>=1.17.2 -tensorflow>=1.14.0 +tensorflow>=1.14.0,<2.0 From fcd14a7abef02849c33f5157100e98a752e00333 Mon Sep 17 00:00:00 2001 From: Chris Goy Date: Mon, 28 Oct 2019 21:42:04 -0700 Subject: [PATCH 4/8] Use stable bokken image. (#2815) --- .yamato/csharp-tests.yml | 2 +- .yamato/standalone-build-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/csharp-tests.yml b/.yamato/csharp-tests.yml index 92eadbfa45..e3e5d5b618 100644 --- a/.yamato/csharp-tests.yml +++ b/.yamato/csharp-tests.yml @@ -15,7 +15,7 @@ triggers: agent: type: Unity::VM::osx - image: ml-agents/ml-agents-bokken-mac:latest + image: ml-agents/ml-agents-bokken-mac:stable flavor: i1.small variables: diff --git a/.yamato/standalone-build-test.yml b/.yamato/standalone-build-test.yml index d29990840e..d2da77da9c 100644 --- a/.yamato/standalone-build-test.yml +++ b/.yamato/standalone-build-test.yml @@ -15,7 +15,7 @@ triggers: agent: type: Unity::VM::osx - image: ml-agents/ml-agents-bokken-mac:latest + image: ml-agents/ml-agents-bokken-mac:stable flavor: i1.small variables: From e2492f824aedeb77394ba999cf54b35bdbb9bd73 Mon Sep 17 00:00:00 2001 From: Chris Elion Date: Tue, 29 Oct 2019 10:39:17 -0700 Subject: [PATCH 5/8] build fixes for 2018+ (#2808) * rename CompressionType enum * fix standalone build test for 2018+ --- .../Editor/Tests/MLAgentsEditModeTest.cs | 4 +-- .../Editor/Tests/StandaloneBuildTest.cs | 29 ++++++++++++++++--- UnitySDK/Assets/ML-Agents/Scripts/Agent.cs | 12 ++++---- .../ML-Agents/Scripts/Sensor/CameraSensor.cs | 4 +-- .../Scripts/Sensor/CompressedObservation.cs | 3 +- .../ML-Agents/Scripts/Sensor/ISensor.cs | 6 ++-- .../Scripts/Sensor/RenderTextureSensor.cs | 4 +-- .../ML-Agents/Scripts/Sensor/SensorBase.cs | 4 +-- 8 files changed, 43 insertions(+), 23 deletions(-) diff --git a/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs b/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs index 3f0be7f596..a5602f2a03 100644 --- a/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs +++ b/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs @@ -93,9 +93,9 @@ public byte[] GetCompressedObservation() return null; } - public CompressionType GetCompressionType() + public SensorCompressionType GetCompressionType() { - return CompressionType.None; + return SensorCompressionType.None; } public string GetName() diff --git a/UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs b/UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs index b344a62c24..d88aacbd43 100644 --- a/UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs +++ b/UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs @@ -1,6 +1,9 @@ using System; using UnityEditor; using UnityEngine; +#if UNITY_2018_1_OR_NEWER +using UnityEditor.Build.Reporting; +#endif namespace MLAgents { @@ -9,8 +12,25 @@ public class StandaloneBuildTest static void BuildStandalonePlayerOSX() { string[] scenes = { "Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity" }; - var error = BuildPipeline.BuildPlayer(scenes, "testPlayer", BuildTarget.StandaloneOSX, BuildOptions.None); - if (string.IsNullOrEmpty(error)) + var buildResult = BuildPipeline.BuildPlayer(scenes, "testPlayer", BuildTarget.StandaloneOSX, BuildOptions.None); +#if UNITY_2018_1_OR_NEWER + var isOK = buildResult.summary.result == BuildResult.Succeeded; + var error = ""; + foreach (var stepInfo in buildResult.steps) + { + foreach (var msg in stepInfo.messages) + { + if (msg.type != LogType.Log && msg.type != LogType.Warning) + { + error += msg.content + "\n"; + } + } + } +#else + var error = buildResult; + var isOK = string.IsNullOrEmpty(error); +#endif + if (isOK) { EditorApplication.Exit(0); } @@ -18,10 +38,11 @@ static void BuildStandalonePlayerOSX() { Console.Error.WriteLine(error); EditorApplication.Exit(1); - + } Debug.Log(error); + } - + } } diff --git a/UnitySDK/Assets/ML-Agents/Scripts/Agent.cs b/UnitySDK/Assets/ML-Agents/Scripts/Agent.cs index d05a65526b..f8abf6dfd6 100644 --- a/UnitySDK/Assets/ML-Agents/Scripts/Agent.cs +++ b/UnitySDK/Assets/ML-Agents/Scripts/Agent.cs @@ -160,7 +160,7 @@ public class AgentParameters /// of the environment extracts its current observation, sends them to its /// policy and in return receives an action. In practice, /// however, an agent need not send its observation at every step since very - /// little may have changed between successive steps. + /// little may have changed between successive steps. /// /// At any step, an agent may be considered . /// This could occur due to a variety of reasons: @@ -328,15 +328,15 @@ void OnDisable() /// /// Updates the Model for the agent. Any model currently assigned to the - /// agent will be replaced with the provided one. If the arguments are + /// agent will be replaced with the provided one. If the arguments are /// identical to the current parameters of the agent, the model will - /// remain unchanged. + /// remain unchanged. /// - /// The identifier of the behavior. This - /// will categorize the agent when training. + /// The identifier of the behavior. This + /// will categorize the agent when training. /// /// The model to use for inference. - /// Define on what device the model + /// Define on what device the model /// will be run. public void GiveModel( string behaviorName, diff --git a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs index fd11898f93..574f226a81 100644 --- a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs +++ b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs @@ -55,9 +55,9 @@ public void WriteToTensor(TensorProxy tensorProxy, int agentIndex) } } - public CompressionType GetCompressionType() + public SensorCompressionType GetCompressionType() { - return CompressionType.PNG; + return SensorCompressionType.PNG; } /// diff --git a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs index b1db192c13..5dfe6f85bf 100644 --- a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs +++ b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs @@ -1,5 +1,4 @@ using System; -using MLAgents.InferenceBrain; using UnityEngine; namespace MLAgents.Sensor @@ -14,7 +13,7 @@ public struct CompressedObservation /// /// The format of the compressed data /// - public CompressionType CompressionType; + public SensorCompressionType CompressionType; /// /// The uncompressed dimensions of the data. diff --git a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs index 0a1040f4ab..49f8068955 100644 --- a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs +++ b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs @@ -2,7 +2,7 @@ namespace MLAgents.Sensor { - public enum CompressionType + public enum SensorCompressionType { None, PNG, @@ -38,10 +38,10 @@ public interface ISensor { byte[] GetCompressedObservation(); /// - /// Return the compression type being used. If no compression is used, return CompressionType.None + /// Return the compression type being used. If no compression is used, return SensorCompressionType.None /// /// - CompressionType GetCompressionType(); + SensorCompressionType GetCompressionType(); /// /// Get the name of the sensor. This is used to ensure deterministic sorting of the sensors on an Agent, diff --git a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs index 424d692a45..871854c809 100644 --- a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs +++ b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs @@ -56,9 +56,9 @@ public void WriteToTensor(TensorProxy tensorProxy, int index) } } - public CompressionType GetCompressionType() + public SensorCompressionType GetCompressionType() { - return CompressionType.PNG; + return SensorCompressionType.PNG; } /// diff --git a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs index cb3de11d94..15eb53bee6 100644 --- a/UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs +++ b/UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs @@ -46,9 +46,9 @@ public virtual byte[] GetCompressedObservation() return null; } - public virtual CompressionType GetCompressionType() + public virtual SensorCompressionType GetCompressionType() { - return CompressionType.None; + return SensorCompressionType.None; } } } From 57a649959a28b0fd790ccd017b160e0f355ea654 Mon Sep 17 00:00:00 2001 From: Chris Goy Date: Tue, 29 Oct 2019 12:13:28 -0700 Subject: [PATCH 6/8] Add more editor versions for testing. (#2809) --- .yamato/csharp-tests.yml | 34 +++++++++------ .yamato/standalone-build-test.yml | 54 ++++++++++++----------- run-standalone-build-osx.sh | 55 +++++++++++++----------- run-tests-editmode-osx-editor.sh | 71 +++++++++++++++++-------------- 4 files changed, 120 insertions(+), 94 deletions(-) diff --git a/.yamato/csharp-tests.yml b/.yamato/csharp-tests.yml index e3e5d5b618..c34d3b7c00 100644 --- a/.yamato/csharp-tests.yml +++ b/.yamato/csharp-tests.yml @@ -1,24 +1,30 @@ -name: Mac Edit Mode Tests -triggers: +test_editors: + - version: 2017.4 + - version: 2018.4 + - version: 2019.3 +--- +{% for editor in test_editors %} +test_mac_editmode_{{ editor.version }}: + name: Test Mac EditMode {{ editor.version }} + agent: + type: Unity::VM::osx + image: ml-agents/ml-agents-bokken-mac:release + flavor: i1.small + variables: + UNITY_VERSION: {{ editor.version }} + commands: + - ./run-tests-editmode-osx-editor.sh + triggers: branches: only: - - "/develop-.*/" + - "/develop-.*/" targets: only: - - "develop" + - "develop" pull_requests: - targets: only: - "master" - "/release-.*/" - "/hotfix-.*/" - -agent: - type: Unity::VM::osx - image: ml-agents/ml-agents-bokken-mac:stable - flavor: i1.small - -variables: - LC_ALL: "en_US.UTF-8" -commands: - - ./run-tests-editmode-osx-editor.sh +{% endfor %} diff --git a/.yamato/standalone-build-test.yml b/.yamato/standalone-build-test.yml index d2da77da9c..e2a9147eb2 100644 --- a/.yamato/standalone-build-test.yml +++ b/.yamato/standalone-build-test.yml @@ -1,24 +1,30 @@ -name: Mac Standalone Build Test -triggers: - branches: - only: - - "/develop-.*/" - targets: - only: - - "develop" - pull_requests: - - targets: - only: - - "master" - - "/release-.*/" - - "/hotfix-.*/" - -agent: - type: Unity::VM::osx - image: ml-agents/ml-agents-bokken-mac:stable - flavor: i1.small - -variables: - LC_ALL: "en_US.UTF-8" -commands: - - ./run-standalone-build-osx.sh +test_editors: + - version: 2017.4 + - version: 2018.4 + - version: 2019.3 +--- +{% for editor in test_editors %} +test_mac_standalone_{{ editor.version }}: + name: Test Mac Standalone {{ editor.version }} + agent: + type: Unity::VM::osx + image: ml-agents/ml-agents-bokken-mac:release + flavor: i1.small + variables: + UNITY_VERSION: {{ editor.version }} + commands: + - ./run-standalone-build-osx.sh + triggers: + branches: + only: + - "/develop-.*/" + targets: + only: + - "develop" + pull_requests: + - targets: + only: + - "master" + - "/release-.*/" + - "/hotfix-.*/" +{% endfor %} \ No newline at end of file diff --git a/run-standalone-build-osx.sh b/run-standalone-build-osx.sh index f780281570..988ba571ec 100755 --- a/run-standalone-build-osx.sh +++ b/run-standalone-build-osx.sh @@ -2,37 +2,44 @@ set -eo pipefail -EDITOR_VERSION="2017.4.33f1" -BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity" -HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity" +if [[ -z "${UNITY_VERSION}" ]]; then + + echo "Environment Variable UNITY_VERSION was not set" + exit 1 -if [[ -f ${BOKKEN_UNITY} ]]; then - UNITY=${BOKKEN_UNITY} else - UNITY=${HUB_UNITY} -fi + BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" + HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" -pushd $(dirname "${0}") > /dev/null -BASETPATH=$(pwd -L) -popd > /dev/null + if [[ -f ${BOKKEN_UNITY} ]]; then + UNITY=${BOKKEN_UNITY} + else + UNITY=${HUB_UNITY} + fi -echo "Cleaning previous results" + pushd $(dirname "${0}") > /dev/null + BASETPATH=$(pwd -L) + popd > /dev/null -echo "Starting tests via $UNITY" + echo "Cleaning previous results" -CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX" + echo "Starting tests via $UNITY" -echo "$CMD_LINE ..." + CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -logfile - -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX" -${CMD_LINE} -RES=$? + echo "$CMD_LINE ..." -if [[ "${RES}" -eq "0" ]]; then - echo "Standalone build completed successfully."; - exit 0; -else - echo "Standalone build failed." - exit 1; -fi + ${CMD_LINE} + RES=$? -exit ${RES} + if [[ "${RES}" -eq "0" ]]; then + echo "Standalone build completed successfully."; + exit 0; + else + echo "Standalone build failed." + exit 1; + fi + + exit ${RES} + +fi diff --git a/run-tests-editmode-osx-editor.sh b/run-tests-editmode-osx-editor.sh index bdaaf04102..6d6c1ae42d 100755 --- a/run-tests-editmode-osx-editor.sh +++ b/run-tests-editmode-osx-editor.sh @@ -2,49 +2,56 @@ set -eo pipefail -EDITOR_VERSION="2017.4.33f1" -BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity" -HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity" +if [[ -z "${UNITY_VERSION}" ]]; then + + echo "Environment Variable UNITY_VERSION was not set" + exit 1 -if [[ -f ${BOKKEN_UNITY} ]]; then - UNITY=${BOKKEN_UNITY} else - UNITY=${HUB_UNITY} -fi + BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" + HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" -pushd $(dirname "${0}") > /dev/null -BASETPATH=$(pwd -L) -popd > /dev/null + if [[ -f ${BOKKEN_UNITY} ]]; then + UNITY=${BOKKEN_UNITY} + else + UNITY=${HUB_UNITY} + fi -echo "Cleaning previous results" + pushd $(dirname "${0}") > /dev/null + BASETPATH=$(pwd -L) + popd > /dev/null -if [[ -e ${BASETPATH}/results.xml ]] -then - rm ${BASETPATH}/results.xml -fi + echo "Cleaning previous results" -echo "Starting tests via $UNITY" + if [[ -e ${BASETPATH}/results.xml ]] + then + rm ${BASETPATH}/results.xml + fi -CMD_LINE="$UNITY -runTests -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode" + echo "Starting tests via $UNITY" -echo "$CMD_LINE ..." + CMD_LINE="$UNITY -runTests -logfile - -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode" -$CMD_LINE -RES=$? + echo "$CMD_LINE ..." -TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') -PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') -FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') -DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') + $CMD_LINE + RES=$? -echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml" + TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') + PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') + FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') + DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}') -if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then - echo "Test run SUCCEEDED!" -else - echo "Test run FAILED!" -fi + echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml" + + if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then + echo "Test run SUCCEEDED!" + else + echo "Test run FAILED!" + fi + + rm "${BASETPATH}/results.xml" -rm "${BASETPATH}/results.xml" + exit ${RES} -exit ${RES} +fi \ No newline at end of file From dfd65a3ba8facaa87b4de3298c7cffdc480cf7e4 Mon Sep 17 00:00:00 2001 From: Chris Elion Date: Tue, 29 Oct 2019 13:36:44 -0700 Subject: [PATCH 7/8] class variable for API verison, fix env tests (#2817) --- ml-agents-envs/mlagents/envs/environment.py | 3 ++- ml-agents-envs/mlagents/envs/mock_communicator.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ml-agents-envs/mlagents/envs/environment.py b/ml-agents-envs/mlagents/envs/environment.py index 197b70bfe2..52fd8132cd 100644 --- a/ml-agents-envs/mlagents/envs/environment.py +++ b/ml-agents-envs/mlagents/envs/environment.py @@ -42,6 +42,7 @@ class UnityEnvironment(BaseUnityEnvironment): SCALAR_ACTION_TYPES = (int, np.int32, np.int64, float, np.float32, np.float64) SINGLE_BRAIN_ACTION_TYPES = SCALAR_ACTION_TYPES + (list, np.ndarray) SINGLE_BRAIN_TEXT_TYPES = list + API_VERSION = "API-11" def __init__( self, @@ -72,7 +73,7 @@ def __init__( atexit.register(self._close) self.port = base_port + worker_id self._buffer_size = 12000 - self._version_ = "API-11" + self._version_ = UnityEnvironment.API_VERSION self._loaded = ( False ) # If true, this means the environment was successfully loaded diff --git a/ml-agents-envs/mlagents/envs/mock_communicator.py b/ml-agents-envs/mlagents/envs/mock_communicator.py index d3cc1e8f88..398af545db 100755 --- a/ml-agents-envs/mlagents/envs/mock_communicator.py +++ b/ml-agents-envs/mlagents/envs/mock_communicator.py @@ -1,4 +1,5 @@ from .communicator import Communicator +from .environment import UnityEnvironment from mlagents.envs.communicator_objects.unity_rl_output_pb2 import UnityRLOutputProto from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto from mlagents.envs.communicator_objects.unity_rl_initialization_output_pb2 import ( @@ -52,7 +53,10 @@ def initialize(self, inputs: UnityInputProto) -> UnityOutputProto: is_training=True, ) rl_init = UnityRLInitializationOutputProto( - name="RealFakeAcademy", version="API-10", log_path="", brain_parameters=[bp] + name="RealFakeAcademy", + version=UnityEnvironment.API_VERSION, + log_path="", + brain_parameters=[bp], ) output = UnityRLOutputProto(agentInfos=self._get_agent_infos()) return UnityOutputProto(rl_initialization_output=rl_init, rl_output=output) From 9503177d6a70b1d1fbc76c8e578ab60473501754 Mon Sep 17 00:00:00 2001 From: Hunter Date: Tue, 29 Oct 2019 15:47:18 -0700 Subject: [PATCH 8/8] fixed area prefab agents were pointing to the wrong laser gameObject. --- .../Prefabs/FoodCollectorArea.prefab | 23 ++++--------------- .../FoodCollector/Scenes/FoodCollector.unity | 5 +--- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab b/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab index 2586ae7b43..01fff3e096 100644 --- a/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab +++ b/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab @@ -3686,7 +3686,6 @@ MonoBehaviour: vectorObservationSize: 53 numStackedVectorObservations: 1 vectorActionSize: 03000000030000000300000002000000 - cameraResolutions: [] vectorActionDescriptions: [] vectorActionSpaceType: 0 m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3} @@ -3705,8 +3704,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agentParameters: - agentCameras: [] - agentRenderTextures: [] maxStep: 5000 resetOnDone: 1 onDemandDecision: 0 @@ -3750,8 +3747,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agentParameters: - agentCameras: [] - agentRenderTextures: [] maxStep: 5000 resetOnDone: 1 onDemandDecision: 0 @@ -3763,7 +3758,7 @@ MonoBehaviour: badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2} goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2} frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2} - myLaser: {fileID: 1081721624670010} + myLaser: {fileID: 1617924810425504} contribute: 0 useVectorObs: 1 --- !u!114 &114192565006091356 @@ -3789,8 +3784,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agentParameters: - agentCameras: [] - agentRenderTextures: [] maxStep: 5000 resetOnDone: 1 onDemandDecision: 0 @@ -3802,7 +3795,7 @@ MonoBehaviour: badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2} goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2} frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2} - myLaser: {fileID: 1081721624670010} + myLaser: {fileID: 1045923826166930} contribute: 0 useVectorObs: 1 --- !u!114 &114374774605792098 @@ -3820,7 +3813,6 @@ MonoBehaviour: vectorObservationSize: 53 numStackedVectorObservations: 1 vectorActionSize: 03000000030000000300000002000000 - cameraResolutions: [] vectorActionDescriptions: [] vectorActionSpaceType: 0 m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3} @@ -3853,7 +3845,6 @@ MonoBehaviour: vectorObservationSize: 53 numStackedVectorObservations: 1 vectorActionSize: 03000000030000000300000002000000 - cameraResolutions: [] vectorActionDescriptions: [] vectorActionSpaceType: 0 m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3} @@ -3872,8 +3863,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agentParameters: - agentCameras: [] - agentRenderTextures: [] maxStep: 5000 resetOnDone: 1 onDemandDecision: 0 @@ -3885,7 +3874,7 @@ MonoBehaviour: badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2} goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2} frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2} - myLaser: {fileID: 1081721624670010} + myLaser: {fileID: 1421240237750412} contribute: 0 useVectorObs: 1 --- !u!114 &114661830999747712 @@ -3911,8 +3900,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agentParameters: - agentCameras: [] - agentRenderTextures: [] maxStep: 5000 resetOnDone: 1 onDemandDecision: 0 @@ -3924,7 +3911,7 @@ MonoBehaviour: badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2} goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2} frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2} - myLaser: {fileID: 1081721624670010} + myLaser: {fileID: 1941433838307300} contribute: 0 useVectorObs: 1 --- !u!114 &114762047763154270 @@ -3964,7 +3951,6 @@ MonoBehaviour: vectorObservationSize: 53 numStackedVectorObservations: 1 vectorActionSize: 03000000030000000300000002000000 - cameraResolutions: [] vectorActionDescriptions: [] vectorActionSpaceType: 0 m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3} @@ -3986,7 +3972,6 @@ MonoBehaviour: vectorObservationSize: 53 numStackedVectorObservations: 1 vectorActionSize: 03000000030000000300000002000000 - cameraResolutions: [] vectorActionDescriptions: [] vectorActionSpaceType: 0 m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3} diff --git a/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/FoodCollector.unity b/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/FoodCollector.unity index cf9500d12b..db8535a5e6 100644 --- a/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/FoodCollector.unity +++ b/UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/FoodCollector.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44971162, g: 0.49977726, b: 0.5756362, a: 1} + m_IndirectSpecularColor: {r: 0.4497121, g: 0.4997778, b: 0.5756369, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 @@ -747,9 +747,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4fe57113e76a5426297487dd6faadc5b, type: 3} m_Name: m_EditorClassIdentifier: - broadcastHub: - brainsToControl: - - {fileID: 11400000, guid: 9e7865ec29c894c2d8c1617b0fa392f9, type: 2} m_TrainingConfiguration: width: 500 height: 500