Skip to content

Commit 7045da7

Browse files
committed
format files.
1 parent cc5c1e8 commit 7045da7

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ and this project adheres to
8080
- `num_updates` and `train_interval` for SAC were replaced with `steps_per_update`. (#3690)
8181
- `WriteAdapter` was renamed to `ObservationWriter`. If you have a custom `ISensor` implementation,
8282
you will need to change the signature of its `Write()` method. (#3834)
83+
- `UnityRLCapabilities` was added to help inform users when RL features are mismatched between C# and Python packages. (#3831)
8384

8485
### Bug Fixes
8586

ml-agents-envs/mlagents_envs/environment.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,18 @@ def get_capabilities_proto() -> UnityRLCapabilitiesProto:
120120
return capabilities
121121

122122
@staticmethod
123-
def check_csharp_capabitlities(unity_package_ver: str, python_package_ver: str, caps: UnityRLCapabilitiesProto):
123+
def warn_csharp_base_capabitlities(
124+
caps: UnityRLCapabilitiesProto, unity_package_ver: str, python_package_ver: str
125+
) -> None:
124126
if not caps.BaseRLCapabilities:
125-
logger.warning("WARNING: The Unity process is not running with the expected base Reinforcement Learning"
126-
" capabilities. Please be sure upgrade the Unity Package to a version that is compatible with this "
127-
"python package.\n"
128-
f"Python package version: {python_package_ver}, C# package version: {unity_package_ver}"
129-
f"Please find the versions that work best together from our release page.\n"
130-
"https://github.com/Unity-Technologies/ml-agents/releases")
131-
132-
127+
logger.warning(
128+
"WARNING: The Unity process is not running with the expected base Reinforcement Learning"
129+
" capabilities. Please be sure upgrade the Unity Package to a version that is compatible with this "
130+
"python package.\n"
131+
f"Python package version: {python_package_ver}, C# package version: {unity_package_ver}"
132+
f"Please find the versions that work best together from our release page.\n"
133+
"https://github.com/Unity-Technologies/ml-agents/releases"
134+
)
133135

134136
def __init__(
135137
self,
@@ -222,7 +224,11 @@ def __init__(
222224
self._close(0)
223225
UnityEnvironment._raise_version_exception(aca_params.communication_version)
224226

225-
UnityEnvironment.check_csharp_capabilities(aca_params.capabilities)
227+
UnityEnvironment.warn_csharp_base_capabitlities(
228+
aca_params.capabilities,
229+
aca_params.package_version,
230+
UnityEnvironment.API_VERSION,
231+
)
226232

227233
self._env_state: Dict[str, Tuple[DecisionSteps, TerminalSteps]] = {}
228234
self._env_specs: Dict[str, BehaviorSpec] = {}

0 commit comments

Comments
 (0)