title: AttributeError: 'module' object has no attribute 'main' for tf.app.run()
body: <p>I am trying to test a short program, which is pretty simple, shown as follows</p>
  
  <pre><code>import numpy as np
  import tensorflow as tf    
  flags = tf.app.flags
  FLAGS = flags.FLAGS    
  import tensorvision.train as train
  import tensorvision.utils as utils    
  flags.DEFINE_string('name', None,
                      'Append a name Tag to run.')
  
  flags.DEFINE_string('hypes', 'hypes/medseg.json',
                      'File storing model parameters.')    
  if __name__ == '__main__':
      tf.app.run()
  </code></pre>
  
  <p>However, running the program gives the following error message,</p>
  
  <pre><code>Traceback (most recent call last):
  File "train.py", line 43, in &lt;module&gt;
    tf.app.run()
  File "/devl/tensorflow/tf_0.12/lib/python3.4/site-  packages/tensorflow/python/platform/app.py", line 39, in run
  main = main or sys.modules['__main__'].main
  AttributeError: 'module' object has no attribute 'main'
  </code></pre>