问题描述:
当 Tensorflow版本为tensorflow-gpu=1.14时候,执行python程序 出现ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject.
解决问题办法:
这种应该是numpy版本过低的缘故,升级numpy的终端命令
pip install --upgrade numpy
升级后发现numpy版本为 numpy==1.19.0,但是执行程序的时候,
可能会出现新的问题:
~/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' ...
~/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' ...
经分析,可能是由于numpy==1.19.0版本过高,因此 将版本更改为numpy=1.16.0 则解决问题
pip install numpy==1.16.0
注:上述问题本人遇到,且成功解决