RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa

来源:互联网 发布:软件销售怎么样 编辑:程序博客网 时间:2024/04/30 11:24

我在运行tensorflow object detection API的demo的时候,出现了下面的错误:

whsyxt@whsyxt:~/Downloads/gaoshengwu/models/research/object_detection$ python object_detection_tutorial.py RuntimeError: module compiled against API version 0xb but this version of numpy is 0xaRuntimeError: module compiled against API version 0xb but this version of numpy is 0xaTraceback (most recent call last):  File "object_detection_tutorial.py", line 17, in <module>    import tensorflow as tf  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>    from tensorflow.python import *  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in <module>    from tensorflow.python import pywrap_tensorflow  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>    raise ImportError(msg)ImportError: Traceback (most recent call last):  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>    from tensorflow.python.pywrap_tensorflow_internal import *  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>    _pywrap_tensorflow_internal = swig_import_helper()  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)ImportError: numpy.core.multiarray failed to importFailed to load the native TensorFlow runtime.See https://www.tensorflow.org/install/install_sources#common_installation_problemsfor some common reasons and solutions.  Include the entire stack traceabove this error message when asking for help.
然后我的解决办法是:

sudo pip install numpy --upgrade
然后就可以完美运行啦。

参考文献

[1].How can I upgrade numpy?.https://stackoverflow.com/questions/28517937/how-can-i-upgrade-numpy
[2].RuntimeError: module compiled against API version a but this version of numpy is 9.https://github.com/Theano/Theano/issues/3623



阅读全文
0 0
原创粉丝点击