浏览代码

check timers for values, run in dev mode (#4927)

/bullet-hell-barracuda-test-1.3.1
GitHub 4 年前
当前提交
4337108b
共有 2 个文件被更改,包括 19 次插入2 次删除
  1. 2
      Project/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs
  2. 19
      ml-agents/tests/yamato/training_int_tests.py

2
Project/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs


scenes,
outputPath,
buildTarget,
BuildOptions.None
BuildOptions.Development
);
var isOk = buildResult.summary.result == BuildResult.Succeeded;
var error = "";

19
ml-agents/tests/yamato/training_int_tests.py


import argparse
import json
import os
import shutil
import sys

subprocess.run(["cat", log_output_path])
return False
else:
print(f"Inference succeeded! Took {end_time - start_time} seconds")
print(f"Inference finished! Took {end_time - start_time} seconds")
# Check the artifacts directory for the timers, so we can get the gauges
timer_file = f"{exe_path}_Data/ML-Agents/Timers/3DBall_timers.json"
with open(timer_file) as f:
timer_data = json.load(f)
gauges = timer_data.get("gauges", {})
rewards = gauges.get("Override_3DBall.CumulativeReward")
max_reward = rewards.get("max")
if max_reward is None:
print(
"Unable to find rewards in timer file. This usually indicates a problem with Barracuda or inference."
)
return False
# We could check that the rewards are over a threshold, but since we train for so short a time,
# the values could be highly variable. So don't do it for now.
return True

正在加载...
取消
保存