Skip to content

Installation issue with Tensorflow-cpu, no module named '_pwyrap_tensorflow_internal' #22512

@Overdrivr

Description

@Overdrivr

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10 server in desktop mode
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: NA
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): tensorflow-gpu 1.10.0
  • Python version: Anaconda x64 3.6
  • Bazel version (if compiling from source): NA
  • GCC/Compiler version (if compiling from source): NA
  • CUDA/cuDNN version: 9.0/7.0
  • GPU model and memory: Q4000
  • Exact command to reproduce: N/A

Describe the problem

  1. Create a python application that imports tensorflow-gpu
  2. Package the application with pyinstaller
  3. Start the generated executable, that crashes while trying to import tensorflow.

The error trace is this:

Traceback (most recent call last):
  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  File "c:\users\paperspace\.virtualenvs\***-ecouzwts\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
  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'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

On the other hand, doing the same process with tensorflow(-cpu) works fine.

I ruled out CUDA/cuDNN installation issue, because if I run my python application using python, it works fine with the GPU version.

I have tried checking at the .exe with dependency_walker, but appart from false-positive missing API-MS-* and EXT-MS-* DLLs, I don't see anything obvious.

So I'm stuck here.
What discrepancy could create an import issue with tensorflow-gpu and not with tensorflow-cpu ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions