Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error after compiling from source #135

Open
c13arm opened this issue Feb 19, 2018 · 7 comments
Open

Import error after compiling from source #135

c13arm opened this issue Feb 19, 2018 · 7 comments

Comments

@c13arm
Copy link

c13arm commented Feb 19, 2018

Describe the Issue

After installing Tensorflow from source I try to import it by typing: "python3" and then "import tensorflow as tf" which results in an error.

Steps to Reproduce

Followed the step-by-step guide by building from source. In the configure file I changed to python3 and library path 3.4. As well as using Bazel 0.8.

Hardware/Software Info

  • Raspberry Pi model: Pi 2 Model B v1.1
  • Operating System used: Raspian GNU/Linux version 8 (jessie)
  • Version of Python used: 3.4.2
  • SD card memory size: 16GB
  • Size of USB/other device used as swap (if building from source): 16GB
  • TensorFlow git commit hash (if building from source): 56422034fe039d7e8a57392957ed0c8b4b4efe56

Relevant Console Output/Logs

Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
--- import tensorflow as tf
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: /usr/local/lib/python3.4/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: _ZN10tensorflow9ConcatCPUINS_8bfloat16EEEvPNS_10DeviceBaseERKSt6vectorISt10unique_ptrINS_6TTypesIT_Li2EiE11ConstMatrixESt14default_deleteIS9_EESaISC_EEPNS8_6MatrixE

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/dist-packages/tensorflow/init.py", line 24, in
from tensorflow.python import * # pylint: disable=redefined-builtin
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: /usr/local/lib/python3.4/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: _ZN10tensorflow9ConcatCPUINS_8bfloat16EEEvPNS_10DeviceBaseERKSt6vectorISt10unique_ptrINS_6TTypesIT_Li2EiE11ConstMatrixESt14default_deleteIS9_EESaISC_EEPNS8_6MatrixE

@tlkh
Copy link

tlkh commented Mar 9, 2018

#133 same issue

@victorguizien
Copy link

Same here.

@tlkh
Copy link

tlkh commented Mar 17, 2018

The fix for me was to compile TF r1.4 instead. It’s working perfectly fine.

@victorguizien
Copy link

The fix for me was to compile TF r1.4 instead. It’s working perfectly fine.

How do you do that?

@krejciadam
Copy link

krejciadam commented Mar 29, 2018

The same problem here (RPi 3 with Ubuntu MATE). Happens with both tensorflow 1.7 and 1.6 for both Python 2.7 and 3.5. I'll keep trying with lower versions of TF - 1.5 and 1.4.

EDIT:
Tensorflow 1.5 with Python 3.5.2 works! Finally successful import.

@zhewang95
Copy link

zhewang95 commented Sep 26, 2018

I found that put libtensorflow_framework.so in your LD_LIBRARY_PATH can solve this problem.

@tianyufang1958
Copy link

I found that put libtensorflow_framework.so in your LD_LIBRARY_PATH can solve this problem.

Hello, I tried the same but no luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants