-
Notifications
You must be signed in to change notification settings - Fork 162
fix: change model_dir to training job name if it is for tuning. #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -192,6 +192,10 @@ def main(): | |||
""" | |||
hyperparameters = framework.env.read_hyperparameters() | |||
env = framework.training_env(hyperparameters=hyperparameters) | |||
|
|||
if '_tuning_objective_metric' in hyperparameters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a comment similar to https://github.com/aws/sagemaker-tensorflow-container/blob/master/src/tf_container/train_entry_point.py#L118-L119 about why we have this logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
@@ -192,6 +192,10 @@ def main(): | |||
""" | |||
hyperparameters = framework.env.read_hyperparameters() | |||
env = framework.training_env(hyperparameters=hyperparameters) | |||
|
|||
if '_tuning_objective_metric' in hyperparameters: | |||
env.hyperparameters['model_dir'] = env.job_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably append env.job_name
to the original model_dir
rather than replacing the original value entirely. (the old version appended to checkpoint_path
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship!
Issue #, if available:
Description of changes:
Change model_dir to training job name if this training job is part of tuning job.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.