去除警告: FutureWarning: In future, it will be treated as `np.float64 == np.dtype(float).type`.

Article Directory:
a warning Causes
Second, the solution to
the recent warnings always reported when using tensorflow-gpu, it is my obsessive-compulsive disorder can he endure it, no! Absolutely can not tolerate! ! !
My environment:

= 7.0 cudnn
CUDA = 9.0
tensorflow-GPU = 1.8 or 1.9, or 1.10.0, or 1.11.0
warning in this environment above configuration will be reported, is the same solution

First, the warning cause analysis
can be seen from the following package warnings, and h5py this is related to the library package

tensorflow TF AS Import
/home/mosheng/miniconda3/envs/swap_back/lib/python3.5/site-packages/h5py/ the init .py: 36: FutureWarning:. Conversion of the In The secoecated Future, Will IT BE Treated AS np.float64 == np.dtype(float).type.
from Import register_converters AS _register_converters ._conv
TF. path
[ '/home/mosheng/miniconda3/envs/swap_back/lib/python3.5/site-packages/tensorflow']
Exit ()
. 1
2
. 3
. 4
. 5
. 6
then check their native h5py current version installed, is h5py = 2.7.1

(swap) mosheng@server:~/miniconda3/envs/swap/lib$ conda list h5py

packages in environment at /home/mosheng/miniconda3/envs/swap:

Name Version Build Channel

h5py 2.7.1
1
2
3
4
5
If you import keras also reported the same mistakes, because keras is tensorflow for the backend.

keras Import
/home/mosheng/miniconda3/envs/swap/lib/python3.5/site-packages/h5py/ the init .py: 36: FutureWarning: Conversion of the In The ARD SECOND Future, Will IT BE Treated AS. np.float64 == np.dtype(float).type.
from. Import register_converters AS _register_converters _conv
the Using TensorFlow backend.
1
2
3
4
Second, the solution to
this problem is caused due h5py version, upgrade version of what h5py can be solved
(I was upgraded from version 2.7.1 to 2.8.0, success removal of the warning)

https://pypi.tuna.tsinghua.edu.cn/simple h5py == -i install PIP 2.8.0
1
Note:

Some might upgrade is: pip install h5py == 2.8.0rc1
I tried this method will not find the version, should the situation arise above, remove rc1 back to the version number.

(swap) mosheng @ Server: ~ / miniconda3 / Envs / swap / lib $ PIP -i install HTTPS: //pypi.tuna.tsinghua.e du.cn/simple h5py == 2.8.0rc1
the Looking in the Indexes: HTTPS: / /pypi.tuna.tsinghua.edu.cn/simple
Collecting h5py == 2.8.0rc1
Could Not Find Version A that satisfies Requirement h5py == The 2.8.0rc1 (versions from:. 2.2. 1, 2.3.0, 2.3.1, 2.4.0, 2.5.0, 2.6.0, 2.7.0, 2.7.1, 2.8.0, 2.9.0)
No matching Distribution found for h5py == 2.8.0rc1
. 1
2
. 3
. 4
. 5
below or reintroduced into tensorflow keras it will not appear warning

import keras
Using TensorFlow backend.
import tensorflow as tf

Guess you like

Origin www.cnblogs.com/enumx/p/12340042.html