GitHub
5 年前
当前提交
e4394d2f
共有 5 个文件被更改,包括 142 次插入 和 22 次删除
-
3.yamato/standalone-build-test.yml
-
25ml-agents/tests/yamato/standalone_build_tests.py
-
61ml-agents/tests/yamato/yamato_utils.py
-
28.yamato/training-int-tests.yml
-
47ml-agents/tests/yamato/training_int_tests.py
|
|||
test_editors: |
|||
- version: 2018.4 |
|||
- version: 2019.3 |
|||
--- |
|||
{% for editor in test_editors %} |
|||
test_mac_training_int_{{ editor.version }}: |
|||
name: Test Mac Fast Training {{ editor.version }} |
|||
agent: |
|||
type: Unity::VM::osx |
|||
image: ml-agents/ml-agents-bokken-mac:0.1.4-492264 |
|||
flavor: b1.small |
|||
variables: |
|||
UNITY_VERSION: {{ editor.version }} |
|||
commands: |
|||
- pip install pyyaml |
|||
- python -u -m ml-agents.tests.yamato.training_int_tests |
|||
triggers: |
|||
pull_requests: |
|||
- targets: |
|||
only: |
|||
- "master" |
|||
- "/release-.*/" |
|||
- "/hotfix-.*/" |
|||
artifacts: |
|||
unit: |
|||
paths: |
|||
- "artifacts/**" |
|||
{% endfor %} |
|
|||
import os |
|||
import sys |
|||
import subprocess |
|||
|
|||
from .yamato_utils import ( |
|||
get_base_path, |
|||
run_standalone_build, |
|||
init_venv, |
|||
override_config_file, |
|||
) |
|||
|
|||
|
|||
def main(): |
|||
nn_file_expected = "./models/ppo/3DBall.nn" |
|||
if os.path.exists(nn_file_expected): |
|||
# Should never happen - make sure nothing leftover from an old test. |
|||
print("Artifacts from previous build found!") |
|||
sys.exit(1) |
|||
|
|||
base_path = get_base_path() |
|||
print(f"Running in base path {base_path}") |
|||
|
|||
build_returncode = run_standalone_build(base_path) |
|||
if build_returncode != 0: |
|||
print("Standalone build FAILED!") |
|||
sys.exit(build_returncode) |
|||
|
|||
init_venv() |
|||
|
|||
# Copy the default training config but override the max_steps parameter |
|||
override_config_file("config/trainer_config.yaml", "override.yaml", max_steps=100) |
|||
|
|||
# TODO pass scene name and exe destination to build |
|||
# TODO make sure we fail if the exe isn't found - see MLA-559 |
|||
mla_learn_cmd = "mlagents-learn override.yaml --train --env=Project/testPlayer --no-graphics --env-args -logFile -" # noqa |
|||
res = subprocess.run(f"source venv/bin/activate; {mla_learn_cmd}", shell=True) |
|||
|
|||
if res.returncode != 0 or not os.path.exists(nn_file_expected): |
|||
print("mlagents-learn run FAILED!") |
|||
sys.exit(1) |
|||
|
|||
print("mlagents-learn run SUCCEEDED!") |
|||
sys.exit(0) |
|||
|
|||
|
|||
if __name__ == "__main__": |
|||
main() |
撰写
预览
正在加载...
取消
保存
Reference in new issue