Python numpy库版本不符合要求

执行OpenFace的训练脚本,遇到如下问题:

/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/_libs/__init__.py:4: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/__init__.py:26: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import (hashtable as _hashtable,
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/dtypes/common.py:6: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import algos, lib
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/util/hashing.py:7: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import hashing, tslib
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/indexes/base.py:7: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import (lib, index as libindex, tslib as libts,
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/tseries/offsets.py:21: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
import pandas._libs.tslibs.offsets as liboffsets
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/ops.py:16: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from pandas._libs import algos as libalgos, ops as libops
/home/zhujian/software/anaconda/anaconda3/envs/openface/lib/python2.7/site-packages/pandas/core/indexes/interval.py:32: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
...
...

网上找到解决方法:RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility

是因为库版本不兼容的原因,具体到当前问题,就是numpy库的最新版本不符合要求,需要使用之前的版本

当前numpy库版本号是1.15.0

(openface) zhujian@zhujian-virtual-machine:~/openface$ conda list numpy
# packages in environment at /home/zhujian/software/anaconda/anaconda3/envs/openface:
#
# Name                    Version                   Build  Channel
numpy                     1.15.0           py27h1b885b7_0  
numpy-base                1.15.0           py27h3dfced4_0  

将它修改为1.14.5

(openface) zhujian@zhujian-virtual-machine:~/openface$ conda install numpy=1.14.5
Solving environment: done

## Package Plan ##

environment location: /home/zhujian/software/anaconda/anaconda3/envs/openface

added / updated specs: 
    - numpy=1.14.5


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    numpy-1.14.5               |   py27h1b885b7_4          35 KB
    numpy-base-1.14.5          |   py27hdbf6ddf_4         4.1 MB
    ------------------------------------------------------------
                                        Total:         4.1 MB

The following packages will be DOWNGRADED:

    numpy:      1.15.0-py27h1b885b7_0 --> 1.14.5-py27h1b885b7_4
    numpy-base: 1.15.0-py27h3dfced4_0 --> 1.14.5-py27hdbf6ddf_4

Proceed ([y]/n)? y


Downloading and Extracting Packages
numpy-1.14.5         | 35 KB     | ################################################################################################################################################################# | 100% 
numpy-base-1.14.5    | 4.1 MB    | ################################################################################################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

参考文章提出用pip的方式

sudo pip uninstall numpy
sudo pip install numpy==1.14.5

修改后就不再有上述问题弹出

你可能感兴趣的:(python)