擅长:python、mysql、java
<p>我想和你做同样的事。我终于发现您需要将model_dir作为参数传递给类构造函数,如下所示:</p>
<pre><code># Instantiate Estimator
nn = tf.contrib.learn.Estimator(model_fn=model_fn,
params=model_params,
model_dir=FLAGS.log_dir)
</code></pre>
<p>您可以在TensorFlow API中看到这一点:<a href="https://www.tensorflow.org/api_docs/python/tf/contrib/learn/Estimator" rel="nofollow noreferrer">https://www.tensorflow.org/api_docs/python/tf/contrib/learn/Estimator</a></p>