import tensorflow时报错警告

import tensorflow 报警告,但不影响程序运行
>>>import tensorflow
/usr/local/anaconda3/envs/tensorflow/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
>>>

原因是h5py的版本与tensorflow版本不配套,版本有点低
>>>import h5py
>>>h5py.__version__
>>>'2.7.1'

先卸载h5py
pip uninstall h5py
在升级安装h5py
pip install --upgrade h5py==2.8.0

安装成功后,不在报警告,成功
>>>import tensorflow
>>>

 

 

你可能感兴趣的:(import tensorflow时报错警告)