【发布时间】:2019-05-19 03:54:35
【问题描述】:
我刚开始学习 tensorflow,碰巧遇到了一个由 IPython 控制台生成的Future Warning。
这是代码块:
import tensorflow as tf
x1 = tf.constant(4)
print(x1)
我将其保存为 "hello.py" 并在 IPython 控制台上逐行执行。
命令成功执行,但以警告告终。
Python 3.6.7 |Anaconda, Inc.| (default, Oct 28 2018, 19:44:12) [MSC v.1915 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 7.2.0 -- An enhanced Interactive Python.
In [1]: import tensorflow as tf
C:\Users\singh\Anaconda3\lib\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
In [2]: x1 = tf.constant(4)
In [3]: print(x1)
Tensor("Const:0", shape=(), dtype=int32)
我不明白为什么会收到此警告。有没有办法解决这个问题?
Tensorflow 版本:1.10.2
Python IDE:Spyder (Anaconda)
操作系统:Windows 10 x64
【问题讨论】:
-
我无法弄清楚这个警告的原因;-P
标签: python-3.x tensorflow