title: 'function' object has no attribute
body: <p>I have the following code in a file called <code>task.py</code>:</p>
  
  <pre><code>def train():
      saver_refine = tf.train.Saver(coarse_refine_params)
      saver_refine.restore(sess, refine_ckpt.model_checkpoint_path)
  </code></pre>
  
  <p>I import from <code>task.py</code>:</p>
  
  <pre><code>from task import train
  
  train.saver_refine.restore(sess, refine_ckpt.model_checkpoint_path)
  </code></pre>
  
  <p>I try to do the above function.</p>
  
  <blockquote>
    <p>Error:AttributeError: 'function' object has no attribute
    'saver_refine'</p>
  </blockquote>
  
  <p>What could be going wrong here?</p>