【问题标题】:Future Warning while importing tensorflow导入张量流时的未来警告
【发布时间】: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

【问题讨论】:

标签: python-3.x tensorflow


【解决方案1】:

使用这个命令行 pip install h5py==2.8.0rc1 包h5py可能有问题,只需升级它就可以解决您的问题

【讨论】:

    猜你喜欢
    • 2020-01-02
    • 1970-01-01
    • 2016-03-10
    • 2020-10-21
    • 1970-01-01
    • 2022-01-22
    • 1970-01-01
    • 2018-07-06
    相关资源
    最近更新 更多