title: Tensorflow-gpu with pyinstaller
body: <p>Trying to distribute a program that relies on tensorflow...</p>
  
  <p>Using tensorflow it works nicely both as script and with pyinstaller.
  Using tensorflow-gpu it works as script but not with pyinstaller.
  The cuda and cudnn dlls have been copied into the bundle folder by pyinstaller.</p>
  
  <p>I use python 3.6.5 and tensorflow 1.7.0. (Can change version if it helps...)</p>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in 
      File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
        exec(bytecode, module.<strong>dict</strong>)
      File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in 
      File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
      File "importlib__init__.py", line 126, in import_module
    ModuleNotFoundError: No module named 'tensorflow.python._pywrap_tensorflow_internal'</p>
    
    <p>During handling of the above exception, another exception occurred:</p>
    
    <p>Traceback (most recent call last):
      File "interface.py", line 14, in 
      File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
        exec(bytecode, module.<strong>dict</strong>)
      File "site-packages\tensorflow__init__.py", line 24, in 
      File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
        exec(bytecode, module.<strong>dict</strong>)
      File "site-packages\tensorflow\python__init__.py", line 49, in 
      File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
        exec(bytecode, module.<strong>dict</strong>)
      File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in 
    ImportError: Traceback (most recent call last):
      File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in 
      File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
        exec(bytecode, module.<strong>dict</strong>)
      File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in 
      File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
      File "importlib__init__.py", line 126, in import_module
    ModuleNotFoundError: No module named 'tensorflow.python._pywrap_tensorflow_internal'</p>
    
    <p>Failed to load the native TensorFlow runtime.</p>
    
    <p>See <a href="https://www.tensorflow.org/install/install_sources#common_installation_problems" rel="noreferrer">https://www.tensorflow.org/install/install_sources#common_installation_problems</a></p>
    
    <p>for some common reasons and solutions.  Include the entire stack trace
    above this error message when asking for help.
    [10816] Failed to execute script interface</p>
  </blockquote>