Skip to content

Commit

Permalink
Upgraded to pytorch 2.1.1, fixed some windows related test issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelalonsojr committed Nov 20, 2023
1 parent 643df35 commit 1733183
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions com.unity.ml-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)

#### ml-agents / ml-agents-envs
- Upgraded to PyTorch 2.1.1

### Minor Changes
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
Expand Down
9 changes: 7 additions & 2 deletions ml-agents-envs/tests/test_envs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from unittest import mock
import pytest

Expand Down Expand Up @@ -53,11 +54,15 @@ def test_port_defaults(
def test_log_file_path_is_set(mock_communicator, mock_launcher):
mock_communicator.return_value = MockCommunicator()
env = UnityEnvironment(
file_name="myfile", worker_id=0, log_folder="./some-log-folder-path"
file_name="myfile",
worker_id=0,
log_folder=os.path.join(".", "some-log-folder-path"),
)
args = env._executable_args()
log_file_index = args.index("-logFile")
assert args[log_file_index + 1] == "./some-log-folder-path/Player-0.log"
assert args[log_file_index + 1] == os.path.join(
".", "some-log-folder-path", "Player-0.log"
)
env.close()


Expand Down
11 changes: 9 additions & 2 deletions ml-agents/mlagents/trainers/tests/test_trainer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,20 @@ def test_setup_init_path(tmpdir, dir_exists):
:return:
"""
test_yaml = """
init_path = os.path.join(
"{}",
"test_setup_init_path_results",
"test_run_id",
"MediumWallJump",
"checkpoint.pt",
)
test_yaml = f"""
behaviors:
BigWallJump:
init_path: BigWallJump-6540981.pt #full path
trainer_type: ppo
MediumWallJump:
init_path: {}/test_setup_init_path_results/test_run_id/MediumWallJump/checkpoint.pt
init_path: {init_path}
trainer_type: ppo
SmallWallJump:
trainer_type: ppo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_var_len_obs_and_goal_poca(num_vis, num_vector, num_var_len, conditionin
POCA_TORCH_CONFIG,
hyperparameters=new_hyperparams,
network_settings=new_network,
max_steps=25000,
max_steps=5000,
)
check_environment_trains(env, {BRAIN_NAME: config})

Expand Down
2 changes: 1 addition & 1 deletion ml-agents/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def run(self):
"Pillow>=4.2.1",
"protobuf>=3.6,<3.20",
"pyyaml>=3.1.0",
"torch>=1.13.1",
"torch>=2.1.1",
"tensorboard>=2.14",
# adding six explicit dependency since tensorboard needs it but doesn't declare it as a dep
"six>=1.16",
Expand Down

0 comments on commit 1733183

Please sign in to comment.