TensorFlow报错:
Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated.
“Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
/Users/haowang/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
>>> exit()
从错误问题来看,是Python包中的h5py除了问题,于是乎,盘它!!!
安装新版本的h5py包
pip install h5py==2.8.0rc1
完美解决:
pip install h5py==2.8.0rc1
Collecting h5py==2.8.0rc1
Downloading https://files.pythonhosted.org/packages/0e/09/03493525c50e7b17ccc70f8cd7a7ff66e1cf39e2763d94a0fe3a888bebfe/h5py-2.8.0rc1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.7MB)
100% |████████████████████████████████| 4.7MB 1.7MB/s
Requirement already satisfied: six in ./anaconda3/lib/python3.6/site-packages (from h5py==2.8.0rc1) (1.11.0)
Requirement already satisfied: numpy>=1.7 in ./anaconda3/lib/python3.6/site-packages (from h5py==2.8.0rc1) (1.14.3)
Installing collected packages: h5py
Found existing installation: h5py 2.7.1
Uninstalling h5py-2.7.1:
Successfully uninstalled h5py-2.7.1
Successfully installed h5py-2.8.0rc1
userde-MacBook-Pro-5:~ haowang$ python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.11.0'