Skip to content
22 changes: 12 additions & 10 deletions compliance/nvidia/TEST01/run_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

import numpy as np

import platform

os_type = platform.system()

sys.path.append(os.getcwd())

dtype_map = {
Expand Down Expand Up @@ -70,6 +74,8 @@ def main():

args = parser.parse_args()

q = '"' if os_type == 'Windows' else "'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use " on both windows and Unix right?


print("Parsing arguments.")
results_dir = args.results_dir
compliance_dir = args.compliance_dir
Expand Down Expand Up @@ -97,16 +103,14 @@ def main():
# run verify accuracy
verify_accuracy_command = (
"python3 "
+ verify_accuracy_binary
+ f"""{q}{verify_accuracy_binary}{q}"""
+ " --dtype "
+ args.dtype
+ unixmode
+ " -r "
+ results_dir
+ "/accuracy/mlperf_log_accuracy.json"
+ f"""{q}{os.path.join(results_dir, "accuracy", "mlperf_log_accuracy.json")}{q}"""
+ " -t "
+ compliance_dir
+ "/mlperf_log_accuracy.json | tee verify_accuracy.txt"
+ f"""{q}{os.path.join(compliance_dir, "mlperf_log_accuracy.json")}{q} | tee verify_accuracy.txt"""
)
try:
os.system(verify_accuracy_command)
Expand All @@ -130,13 +134,11 @@ def main():
)
verify_performance_command = (
"python3 "
+ verify_performance_binary
+ f"""{q}{verify_performance_binary}{q}"""
+ " -r "
+ results_dir
+ "/performance/run_1/mlperf_log_summary.txt"
+ f"""{q}{os.path.join(results_dir, "performance", "run_1", "mlperf_log_summary.txt")}{q}"""
+ " -t "
+ compliance_dir
+ "/mlperf_log_summary.txt | tee verify_performance.txt"
+ f"""{q}{os.path.join(compliance_dir, "mlperf_log_summary.txt")}{q} | tee verify_performance.txt"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tee won't work on Windows right?

)
try:
os.system(verify_performance_command)
Expand Down
14 changes: 9 additions & 5 deletions compliance/nvidia/TEST04/run_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import subprocess
import argparse

import platform

os_type = platform.system()

sys.path.append(os.getcwd())


Expand Down Expand Up @@ -48,6 +52,8 @@ def main():

args = parser.parse_args()

q = '"' if os_type == 'Windows' else "'"

print("Parsing arguments.")
results_dir = args.results_dir
compliance_dir = args.compliance_dir
Expand All @@ -59,13 +65,11 @@ def main():
)
verify_performance_command = (
"python3 "
+ verify_performance_binary
+ f"""{q}{verify_performance_binary}{q}"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt we use os.path.join here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned similar code parts in 6657bf7

+ " -r "
+ results_dir
+ "/performance/run_1/mlperf_log_summary.txt"
+ f"""{q}{os.path.join(results_dir, "performance", "run_1", "mlperf_log_summary.txt")}{q}"""
+ " -t "
+ compliance_dir
+ "/mlperf_log_summary.txt | tee verify_performance.txt"
+ f"""{q}{os.path.join(compliance_dir, "mlperf_log_summary.txt"}{q} | tee verify_performance.txt"""
)
try:
os.system(verify_performance_command)
Expand Down
2 changes: 1 addition & 1 deletion vision/classification_and_detection/run_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source ./run_common.sh

common_opt=""
dataset="--dataset-path $DATA_DIR"
dataset="--dataset-path \"$DATA_DIR\""
OUTPUT_DIR=${OUTPUT_DIR:-`pwd`/output/$name}
if [ ! -d "$OUTPUT_DIR" ]; then
mkdir -p "$OUTPUT_DIR"
Expand Down