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

Failed to load the native TensorFlow runtime in Mac OSX #24642

Closed
mikkokotila opened this issue Dec 31, 2018 · 4 comments
Closed

Failed to load the native TensorFlow runtime in Mac OSX #24642

mikkokotila opened this issue Dec 31, 2018 · 4 comments
Assignees
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues

Comments

@mikkokotila
Copy link

mikkokotila commented Dec 31, 2018

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • Mac OSX 10.11.6
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed with pip
  • TensorFlow version: 1.12.0
  • Python version: 3.6.6

Describe the problem

Everything was ok with an older version, but with the current version install pass ok but when try to import, many errors are produced.

Provide the exact sequence of commands / steps that you executed before running into the problem

import tensorflow

Any other info / logs

Traceback (most recent call last):
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/Users/mikko/dev/wip/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/mikko/dev/wip/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _clock_gettime
  Referenced from: /Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so (which was built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so

During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/Users/mikko/dev/wip/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/mikko/dev/wip/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _clock_gettime
  Referenced from: /Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so (which was built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/mikko/dev/wip/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

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

@ymodak ymodak added the type:build/install Build and install issues label Jan 3, 2019
@ymodak ymodak self-assigned this Jan 9, 2019
@ymodak
Copy link
Contributor

ymodak commented Jan 9, 2019

I suspect your operating system does not follow AVX instruction sets. TensorFlow official release binaries version 1.6 and higher are prebuilt with AVX instruction sets. In the case of macOS, TF is tested and supported against macOS 10.12.6 (Sierra) or later. To use Tensorflow on old CPUs you'll need to build a binary on your own.

@ymodak ymodak added the stat:awaiting response Status - Awaiting response from author label Jan 9, 2019
@ymodak ymodak closed this as completed Jan 11, 2019
@mikkokotila
Copy link
Author

Thanks @ymodak.

Some useful workarounds to this issue for macOS X versions < 10.12.6:

  1. install a specific version (at least 1.5 confirmed to work)

pip install tensorflow==1.5

  1. Use conda

conda install tensorflow

Both tested and solve the issue.

@ymodak
Copy link
Contributor

ymodak commented Jan 17, 2019

Thanks for the workarounds!

@kaushalrai7797
Copy link

I am getting the same error, While trying to pip install 1.5 tensorflow i get this error.

Collecting tensorflow==1.5
Could not find a version that satisfies the requirement tensorflow==1.5 (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0)
No matching distribution found for tensorflow==1.5

is there any other workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants