Skip to content

Commit 1453fd0

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

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-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: 3 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,11 @@ 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", worker_id=0, log_folder= os.path.join(".", "some-log-folder-path")
5758
)
5859
args = env._executable_args()
5960
log_file_index = args.index("-logFile")
60-
assert args[log_file_index + 1] == "./some-log-folder-path/Player-0.log"
61+
assert args[log_file_index + 1] == os.path.join(".", "some-log-folder-path","Player-0.log")
6162
env.close()
6263

6364

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,14 @@ def test_setup_init_path(tmpdir, dir_exists):
149149
150150
:return:
151151
"""
152-
test_yaml = """
152+
init_path = os.path.join("{}", "test_setup_init_path_results", "test_run_id", "MediumWallJump", "checkpoint.pt")
153+
test_yaml = f"""
153154
behaviors:
154155
BigWallJump:
155156
init_path: BigWallJump-6540981.pt #full path
156157
trainer_type: ppo
157158
MediumWallJump:
158-
init_path: {}/test_setup_init_path_results/test_run_id/MediumWallJump/checkpoint.pt
159+
init_path: {init_path}
159160
trainer_type: ppo
160161
SmallWallJump:
161162
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)