Skip to content

Commit 1733183

Browse files
author
Miguel Alonso Jr
committed
Upgraded to pytorch 2.1.1, fixed some windows related test issues.
1 parent 643df35 commit 1733183

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to
1111
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
1212

1313
#### ml-agents / ml-agents-envs
14+
- Upgraded to PyTorch 2.1.1
1415

1516
### Minor Changes
1617
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)

ml-agents-envs/tests/test_envs.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from unittest import mock
23
import pytest
34

@@ -53,11 +54,15 @@ def test_port_defaults(
5354
def test_log_file_path_is_set(mock_communicator, mock_launcher):
5455
mock_communicator.return_value = MockCommunicator()
5556
env = UnityEnvironment(
56-
file_name="myfile", worker_id=0, log_folder="./some-log-folder-path"
57+
file_name="myfile",
58+
worker_id=0,
59+
log_folder=os.path.join(".", "some-log-folder-path"),
5760
)
5861
args = env._executable_args()
5962
log_file_index = args.index("-logFile")
60-
assert args[log_file_index + 1] == "./some-log-folder-path/Player-0.log"
63+
assert args[log_file_index + 1] == os.path.join(
64+
".", "some-log-folder-path", "Player-0.log"
65+
)
6166
env.close()
6267

6368

ml-agents/mlagents/trainers/tests/test_trainer_util.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,20 @@ def test_setup_init_path(tmpdir, dir_exists):
149149
150150
:return:
151151
"""
152-
test_yaml = """
152+
init_path = os.path.join(
153+
"{}",
154+
"test_setup_init_path_results",
155+
"test_run_id",
156+
"MediumWallJump",
157+
"checkpoint.pt",
158+
)
159+
test_yaml = f"""
153160
behaviors:
154161
BigWallJump:
155162
init_path: BigWallJump-6540981.pt #full path
156163
trainer_type: ppo
157164
MediumWallJump:
158-
init_path: {}/test_setup_init_path_results/test_run_id/MediumWallJump/checkpoint.pt
165+
init_path: {init_path}
159166
trainer_type: ppo
160167
SmallWallJump:
161168
trainer_type: ppo

ml-agents/mlagents/trainers/tests/torch_entities/test_simple_rl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_var_len_obs_and_goal_poca(num_vis, num_vector, num_var_len, conditionin
9393
POCA_TORCH_CONFIG,
9494
hyperparameters=new_hyperparams,
9595
network_settings=new_network,
96-
max_steps=25000,
96+
max_steps=5000,
9797
)
9898
check_environment_trains(env, {BRAIN_NAME: config})
9999

ml-agents/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def run(self):
6262
"Pillow>=4.2.1",
6363
"protobuf>=3.6,<3.20",
6464
"pyyaml>=3.1.0",
65-
"torch>=1.13.1",
65+
"torch>=2.1.1",
6666
"tensorboard>=2.14",
6767
# adding six explicit dependency since tensorboard needs it but doesn't declare it as a dep
6868
"six>=1.16",

0 commit comments

Comments
 (0)