python - tensorflow - FutureWarning

标签 python tensorflow

这是我输入 import tensorflow 时遇到的问题

c:\users\otter\appdata\local\programs\python\python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
c:\users\otter\appdata\local\programs\python\python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
c:\users\otter\appdata\local\programs\python\python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
c:\users\otter\appdata\local\programs\python\python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
c:\users\otter\appdata\local\programs\python\python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
c:\users\otter\appdata\local\programs\python\python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

我的安装过程:

第一:pip install tensorflow==1.13.1 --ignore-installed

第二:pip install tensorflow-gpu==1.15

我的 Cuda 版本是 10.0,cudnn 是 v7.6.5

为什么 numpy 会抛出所有这些错误?

我必须将 Tensorflow 1.31.1 与 GPU 结合使用,因为我正在做的项目不支持 Tensorflow 2.x :(

最佳答案

我解决了!

执行pip卸载numpy

然后执行pip install numpy==1.16.4

旧版本的 Tensorflow 不支持新版本的 Numpy。

关于python - tensorflow - FutureWarning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60613980/

相关文章:

python - Keras 预测精度与训练精度不匹配

python - 使用 Accept header 对 TastyPie Api 进行版本控制

当我尝试运行文件时 Pythonw 崩溃

python - 在 Pandas 中阅读维基百科表格时数值呈现不当

python - 为什么在 Django 模型中需要这个方法?

Python pandas,多行的绘图选项

python - 在 keras 中,Float16 比 float32 慢

python - 如何将 tf.data 转换应用于 DataFrame

python - 如何在多个GPU上运行classify_image?

python - Tensorflow 服务客户端/Base64 问题/错误 3