从crontab运行程序时无法加载本机TensorFlow运行时

时间:2018-07-06 06:21:26

标签: python tensorflow cron tflearn

从crontab加载tensorflow库时出现此错误 如果我在不使用crontab的情况下运行该脚本,那么它将正常工作。

Traceback (most recent call last):
  File "/Users/pythonuser/Documents/Cron/runner.py", line 15, in <module>
    import class2
  File "/Users/pythonuser/Documents/Cron/class2.py", line 9, in <module>
    import tensorflow as tf
  File "/Users/pythonuser/miniconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/Users/pythonuser/miniconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/pythonuser/miniconda3/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/pythonuser/miniconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/pythonuser/miniconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/pythonuser/miniconda3/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)
ImportError: dlopen(/Users/pythonuser/miniconda3/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: __Py_FalseStruct
  Referenced from: /Users/pythonuser/miniconda3/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
  Expected in: flat namespace
 in /Users/pythonuser/miniconda3/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so


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.

0 个答案:

没有答案