Useful or not, from you.
tensorflow module 'tensorflow.python._pywrap_tensorflow_internal' has no attribute 'TFE_NewContextOptions'

I have followed the TensorFlow tutorial, "Simple Audio Recognition"

When I was running train.py, I got this error message:

AttributeError                            Traceback (most recent call last)
<ipython-input-4-61266873bc5f> in <module>()
     77 import numpy as np
     78 from six.moves import xrange  # pylint: disable=redefined-builtin
---> 79 import tensorflow as tf
     80 
     81 import input_data

c:\users\jinsu\appdata\local\programs\python\python36\lib\site-packages\tensorflow\__init__.py in <module>()
     22 
     23 # pylint: disable=wildcard-import
---> 24 from tensorflow.python import *
     25 # pylint: enable=wildcard-import
     26 

c:\users\jinsu\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\__init__.py in <module>()
     47 import numpy as np
     48 
---> 49 from tensorflow.python import pywrap_tensorflow
     50 
     51 # Protocol buffers

c:\users\jinsu\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
     56     sys.setdlopenflags(_default_dlopen_flags | ctypes.RTLD_LOCAL)
     57 
---> 58   from tensorflow.python.pywrap_tensorflow_internal import *
     59   from tensorflow.python.pywrap_tensorflow_internal import __version__
     60   from tensorflow.python.pywrap_tensorflow_internal import __git_version__

c:\users\jinsu\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>()
    102 def TFE_NewContextOptions():
    103     return _pywrap_tensorflow_internal.TFE_NewContextOptions()
--> 104 TFE_NewContextOptions = _pywrap_tensorflow_internal.TFE_NewContextOptions
    105 
    106 def TFE_ContextOptionsSetConfig(options, proto, proto_len, status):

AttributeError: module 'tensorflow.python._pywrap_tensorflow_internal' has no attribute 'TFE_NewContextOptions'

So, I checked out pywrap_tensorflow_internal.py in the pyhton directory. This is the part of pywrap_tensorflow_internal.py that defines TFE_NewContextOptions.

def TFE_ContextOptionsSetConfig(options, proto, proto_len, status):
    return _pywrap_tensorflow_internal.TFE_ContextOptionsSetConfig(options, proto, proto_len, status)
TFE_ContextOptionsSetConfig = _pywrap_tensorflow_internal.TFE_ContextOptionsSetConfig
TFE_DEVICE_PLACEMENT_EXPLICIT = _pywrap_tensorflow_internal.TFE_DEVICE_PLACEMENT_EXPLICIT
TFE_DEVICE_PLACEMENT_WARN = _pywrap_tensorflow_internal.TFE_DEVICE_PLACEMENT_WARN
TFE_DEVICE_PLACEMENT_SILENT = _pywrap_tensorflow_internal.TFE_DEVICE_PLACEMENT_SILENT
TFE_DEVICE_PLACEMENT_SILENT_FOR_INT32 = _pywrap_tensorflow_internal.TFE_DEVICE_PLACEMENT_SILENT_FOR_INT32
That's a useful answer
Without any help

I had similar issue. My problem was that my tensorflow and tensorflow-gpu installation was mixing up. To solve this, I ran pip uninstall tensorflow tensorflow-gpu and removed those tensorflow folders manually in python36\lib\site-packages. Then, reinstall again.