Skip to content

Commit

Permalink
Create a unique path for Evaluation Simtrace (#95)
Browse files Browse the repository at this point in the history
* Fixing evaluation trace path

* Fix parameter sequence
  • Loading branch information
larsll authored Aug 4, 2022
1 parent 4afada5 commit 0c80250
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/evaluation/prepare-config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python3

import boto3
from datetime import datetime
import sys
import os
import time
Expand All @@ -11,6 +12,8 @@
def str2bool(v):
return v.lower() in ("yes", "true", "t", "1")

eval_time = datetime.now().strftime('%Y%m%d%H%M%S')

config = {}
config['CAR_COLOR'] = []
config['BODY_SHELL_TYPE'] = []
Expand All @@ -35,15 +38,17 @@ def str2bool(v):
config['MODEL_S3_PREFIX'].append(os.environ.get('DR_LOCAL_S3_MODEL_PREFIX', 'rl-deepracer-sagemaker'))
config['MODEL_S3_BUCKET'].append(os.environ.get('DR_LOCAL_S3_BUCKET', 'bucket'))
config['SIMTRACE_S3_BUCKET'].append(os.environ.get('DR_LOCAL_S3_BUCKET', 'bucket'))
config['SIMTRACE_S3_PREFIX'].append(os.environ.get('DR_LOCAL_S3_MODEL_PREFIX', 'rl-deepracer-sagemaker'))
config['SIMTRACE_S3_PREFIX'].append(
'{}/evaluation-{}'.format(os.environ.get('DR_LOCAL_S3_MODEL_PREFIX', 'rl-deepracer-sagemaker'), eval_time)
)

# Metrics
config['METRICS_S3_BUCKET'].append(os.environ.get('DR_LOCAL_S3_BUCKET', 'bucket'))
metrics_prefix = os.environ.get('DR_LOCAL_S3_METRICS_PREFIX', None)
if metrics_prefix is not None:
config['METRICS_S3_OBJECT_KEY'].append('{}/EvaluationMetrics-{}.json'.format(metrics_prefix, str(round(time.time()))))
config['METRICS_S3_OBJECT_KEY'].append('{}/EvaluationMetrics-{}.json'.format(metrics_prefix, eval_time))
else:
config['METRICS_S3_OBJECT_KEY'].append('DeepRacer-Metrics/EvaluationMetrics-{}.json'.format(str(round(time.time()))))
config['METRICS_S3_OBJECT_KEY'].append('DeepRacer-Metrics/EvaluationMetrics-{}.json'.format(eval_time))

# MP4 configuration / sav
save_mp4 = str2bool(os.environ.get("DR_EVAL_SAVE_MP4", "False"))
Expand Down

0 comments on commit 0c80250

Please sign in to comment.