python-3.x - 导入张量流时的未来警告
问题描述
我刚开始学习 tensorflow,碰巧通过了 IPython 控制台生成的未来警告。
这是代码块:
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
解决方案
使用这个命令行 pip install h5py==2.8.0rc1 包 h5py 可能有问题,只需升级它就可以解决你的问题
推荐阅读
- django - 有没有办法通过 Django 模板在 if 条件中使用模型字段?
- python - 如何更快地裁剪出高振幅的音频部分
- c# - Add-Type 不支持字典初始化语法?
- java - 重构 if else 分支的最佳方法是什么
- angular - 何时使用 Angular mat-card 组件
- python - 如何使用 Oracle 表中的 Nans 更新 Pandas 数据框,以使 Nans 变为 NULL?
- jquery - TinyMCE 中的奇怪问题 - WIRIS
- azure - Azure ADF - 删除不同组件的顺序应该是什么
- java - 不确定密码检查器的逻辑错误在哪里
- python - 图像压缩后将图像评论转移到新评论