Skip to content

Commit b948f87

Browse files
author
Chris Elion
authored
check timers for values, run in dev mode (#4927)
1 parent 24b8d8b commit b948f87

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static void BuildStandalonePlayerOSX()
4141
scenes,
4242
outputPath,
4343
buildTarget,
44-
BuildOptions.None
44+
BuildOptions.Development
4545
);
4646
var isOk = buildResult.summary.result == BuildResult.Succeeded;
4747
var error = "";

ml-agents/tests/yamato/training_int_tests.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import argparse
2+
import json
23
import os
34
import shutil
45
import sys
@@ -157,7 +158,23 @@ def run_inference(env_path: str, output_path: str, model_extension: str) -> bool
157158
subprocess.run(["cat", log_output_path])
158159
return False
159160
else:
160-
print(f"Inference succeeded! Took {end_time - start_time} seconds")
161+
print(f"Inference finished! Took {end_time - start_time} seconds")
162+
163+
# Check the artifacts directory for the timers, so we can get the gauges
164+
timer_file = f"{exe_path}_Data/ML-Agents/Timers/3DBall_timers.json"
165+
with open(timer_file) as f:
166+
timer_data = json.load(f)
167+
168+
gauges = timer_data.get("gauges", {})
169+
rewards = gauges.get("Override_3DBall.CumulativeReward")
170+
max_reward = rewards.get("max")
171+
if max_reward is None:
172+
print(
173+
"Unable to find rewards in timer file. This usually indicates a problem with Barracuda or inference."
174+
)
175+
return False
176+
# We could check that the rewards are over a threshold, but since we train for so short a time,
177+
# the values could be highly variable. So don't do it for now.
161178

162179
return True
163180

0 commit comments

Comments
 (0)