美文网首页
TensorFlow Problems

TensorFlow Problems

作者: 糊糊小鱼干 | 来源:发表于2018-06-02 14:43 被阅读0次

    问题1

    描述

    import tensorflow
    

    控制台输出

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

    解决

    numpy版本问题,需要升级

    pip install numpy --upgrade
    

    控制台输出

    Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
    Collecting numpy
      Downloading https://mirrors.ustc.edu.cn/pypi/web/packages/c0/e7/08f059a00367fd613e4f2875a16c70b6237268a1d6d166c6d36acada8301/numpy-1.14.3-cp27-cp27mu-manylinux1_x86_64.whl (12.1MB)
        100% |████████████████████████████████| 12.1MB 73.3MB/s 
    mxnet-cu90 1.1.0 has requirement numpy<=1.13.3, but you'll have numpy 1.14.3 which is incompatible.
    Installing collected packages: numpy
      Found existing installation: numpy 1.13.3
        Uninstalling numpy-1.13.3:
          Successfully uninstalled numpy-1.13.3
    Successfully installed numpy-1.14.3
    

    再次尝试tensorflow

    (venv) py@VIPA207:~/tensorflow$ python
    Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
    [GCC 5.4.0 20160609] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import tensorflow
    >>> 
    

    疑点:可以看出tensorflow是没什么问题了,但是控制台输出中有这样一句

    mxnet-cu90 1.1.0 has requirement numpy<=1.13.3, but you'll have numpy 1.14.3 which is incompatible.
    

    可知新升级的numpy版本与mxnet需要的版本冲突了,也许只能再用一个虚拟环境才能解决这二者之间numpy版本矛盾的问题了!

    相关文章

      网友评论

          本文标题:TensorFlow Problems

          本文链接:https://www.haomeiwen.com/subject/oujrsftx.html