FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated.


相关环境

h5py              2.7.1
tensorflow        1.8.0
scikit-learn      0.19.1
numpy             1.14.3
pandas            0.22.0

问题描述

$ python train_model.py
/path/to/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
Using TensorFlow backend.
Traceback (most recent call last):
  File "train_model.py", line 51, in <module>
    lb = LabelBinarizer().fit(Y_train)
  File "/path/to/lib/python3.6/site-packages/sklearn/preprocessing/label.py", line 281, in fit
    raise ValueError('y has 0 samples: %r' % y)
ValueError: y has 0 samples: array([], dtype=float64)

解决方法

安装特定版本的库就可以了!

pip install h5py==2.8.0rc1

参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录