Open athewsey opened 4 years ago
the reason you're seeing this behavior is because attach()
is a class method that returns a new instance of the estimator. This is so you don't have to instantiate a new estimator just to attach an old training job, i.e.
estimator = TensorFlow.attach(...)
instead of
tf = TensorFlow(...)
estimator = tf.attach(...)
I can see how this is unintuitive, though, when using it with an existing estimator, so I'll leave this issue open and marked as an "enhancement"
Understood, thanks!
Describe the bug
When
estimator.attach()
ing to a training job older than the most recent job previously kicked off by.fit()
on that same estimator object; Calling.deploy()
does not properly deploy the attached job as expected; but tries to interrogate artifacts from the more recent (perhaps still in-progress) job - which can trigger an error.This issue is probably only really relevant for interactive session use cases e.g. notebooks.
To reproduce
TensorFlow
estimatorattach()
ed to and deploy..fit()
) and resume the interactive shell before that job is finished (e.g. by specifyingwait=False
, or just using Ctrl+C)estimator.attach()
to the previous, completed and valid training jobestimator.deploy()
Expected behavior
Because we've explicitly attached the estimator to a job since the last time we triggered one, would expect subsequent
deploy()
calls to refer to theattach()
ed job, regardless of the relative age of the job.Screenshots or logs (Actual behavior)
In actual fact, a
KeyError
is thrown because the estimator tries accessing model artifacts from theself.latest_training_job.name
rather than the attached job (and we ran bothattach()
anddeploy()
before that most recent job finished):System information A description of your system. Please provide:
Additional context Add any other context about the problem here.