在Python交互式窗口导入tensorflow出现了下面的错误:

  1. root@ubuntu:~# python3
  2. Python 3.6.8 (default, Oct 7 2019, 12:59:55)
  3. [GCC 8.3.0] on linux
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>> import tensorflow as tf;
  6. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:516: 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'.
  7. _np_qint8 = np.dtype([("qint8", np.int8, 1)])
  8. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:517: 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'.
  9. _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
  10. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:518: 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'.
  11. _np_qint16 = np.dtype([("qint16", np.int16, 1)])
  12. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:519: 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'.
  13. _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
  14. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:520: 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'.
  15. _np_qint32 = np.dtype([("qint32", np.int32, 1)])
  16. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:525: 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'.
  17. np_resource = np.dtype([("resource", np.ubyte, 1)])
  18. /usr/local/lib/python3.6/dist-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'.
  19. _np_qint8 = np.dtype([("qint8", np.int8, 1)])
  20. /usr/local/lib/python3.6/dist-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'.
  21. _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
  22. /usr/local/lib/python3.6/dist-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'.
  23. _np_qint16 = np.dtype([("qint16", np.int16, 1)])
  24. /usr/local/lib/python3.6/dist-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'.
  25. _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
  26. /usr/local/lib/python3.6/dist-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'.
  27. _np_qint32 = np.dtype([("qint32", np.int32, 1)])
  28. /usr/local/lib/python3.6/dist-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'.
  29. np_resource = np.dtype([("resource", np.ubyte, 1)])

我的错误原因是numpy的版本较高造成的,换成1.14.0版本后解决了

出错时的Numpy版本

  1. root@ubuntu:~# pip3 show numpy
  2. Name: numpy
  3. Version: 1.17.3
  4. Summary: NumPy is the fundamental package for array computing with Python.
  5. Home-page: https://www.numpy.org
  6. Author: Travis E. Oliphant et al.
  7. Author-email: None
  8. License: BSD
  9. Location: /usr/local/lib/python3.6/dist-packages
  10. Requires:

安装1.14.0的Numpy版本

  1. root@ubuntu:~# pip3 install numpy==1.14.0
  2. Collecting numpy==1.14.0
  3. Downloading https://files.pythonhosted.org/packages/dc/ac/5c270dffb864f23315e9c1f9e0a0b300c797b3c170666c031c4de42aacae/numpy-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (17.2MB)
  4. 100% |████████████████████████████████| 17.2MB 75kB/s
  5. Installing collected packages: numpy
  6. Successfully installed numpy-1.14.0
  7. root@ubuntu:~# python3
  8. Python 3.6.8 (default, Oct 7 2019, 12:59:55)
  9. [GCC 8.3.0] on linux
  10. Type "help", "copyright", "credits" or "license" for more information.
  11. >>> import tensorflow as tf;
  12. >>> tf.__version__
  13. '1.14.0'
  14. >>>

tensorflow与numpy的版本兼容性问题的更多相关文章

  1. python和numpy的版本、安装位置

    命令行下查看python和numpy的版本和安装位置 1.查看python版本 方法一: python -V 注意:‘-V‘中‘V’为大写字母,只有一个‘-’ 方法二: python --versio ...

  2. [开发技巧]·TensorFlow中numpy与tensor数据相互转化

    [开发技巧]·TensorFlow中numpy与tensor数据相互转化 个人主页–> https://xiaosongshine.github.io/ - 问题描述 在我们使用TensorFl ...

  3. 如何查看安装python和numpy的版本

    命令行下查看python和numpy的版本和安装位置 1.查看python版本 方法一: python -V 注意:‘-V‘中‘V’为大写字母,只有一个‘-’ 方法二: python --versio ...

  4. 命令行下查看python和numpy的版本和安装位置

    命令行下查看python和numpy的版本和安装位置 1.查看python版本 方法一: python -V 注意:‘-V‘中‘V’为大写字母,只有一个‘-’ 方法二: python --versio ...

  5. CUDA、tensorflow与cuDNN的版本匹配问题【转】

    本文转载自:https://blog.csdn.net/MahoneSun/article/details/80809042 一.问题现象 CUDA.tensorflow 与 cuDNN有版本匹配的问 ...

  6. (转载)CUDA、tensorflow与cuDNN的版本匹配问题

    转载:https://blog.csdn.net/MahoneSun/article/details/80809042 CUDA.tensorflow与cuDNN的版本匹配问题 一.问题现象 CUDA ...

  7. ClientDataSet的版本兼容性

    ClientDataSet的版本兼容性 在Delphi的早期版本中,Data这个Variant类型的值内部使用的是AnsiString来存贮的字节流,但我并不确定Delphi从什么时候开始,将其改为了 ...

  8. 10. 选主算法、多版本兼容性及滚动升级 | 深入浅出MGR

    GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 目录 1. 选主算法 2. 多版本兼容性 3. MGR 5.7滚动升级至8.0 4. 小结 参考资料.文档 免责声明 文章 ...

  9. 解决导入TensorFlow后出现警告的的问题解决:通过降低numpy的版本

    在原有基础上安装tensorflow 重新虚拟出一个环境安装tensorflow 安装 测试 大多教程都是重新虚拟出一个环境,原有环境就可以支持为什么还要重建一个新的环境,如果以后遇到坑了更新解释. ...

随机推荐

  1. 【转】行内元素和inline-block产生的水平空隙bug

    重构工程师们在设计代码时,有喜欢手动删除行内元素之间产生的额外空隙,并通过设置margin或padding来获取想要间距吗?如代码: <div class=“”><span clas ...

  2. Red Team远程控制软件

    开源远程管理控制 https://github.com/malwaredllc/byob 僵尸网络生成框架 https://github.com/panda-re/lava 大规模向程序中植入恶意程序 ...

  3. MySQL(四)InnoDB中一棵B+树能存多少行数据

    一.InnoDB一棵B+树可以存放多少行数据?(约2千万) 我们都知道计算机在存储数据的时候,有最小存储单元,这就好比我们今天进行现金的流通最小单位是一毛.在计算机中磁盘存储数据最小单元是扇区,一个扇 ...

  4. idea的项目转maven项目

    鼠标右键pom.xml>>>>>> Add as Maven Project

  5. myeclipse 相关问题

    [如何设置 Tab 键为四个空格] https://blog.csdn.net/QQ826688096/article/details/90543252

  6. 【Docker】:全面认识Docker和基本指令

    Docker逐渐成为虚拟化技术的佼佼者,接下来会推出一系列的Docker相关技术文章,Docker技术也是架构师的必备技能. 什么是Docker Docker 是一个开源的应用容器引擎,基于Go语言, ...

  7. wc 指令

    统计文件的行数, 字符数, 字节数. wc 命令的功能相对简单,参数也较少,但是是统计文本行数,字符数的利器.具体的参数和用法如下 语法 wc [OPTION]... [FILE]... wc [OP ...

  8. git彻底删除或变更子模块

    今天遇到一个很怪的问题,我想把我的一个子模块切换到另一个上游,我按照网上的方法删除子模块然后新建后,这个子模块依旧跟踪着我先前的上游.自己摸索了一下,可能方法比较傻,不过是可行的,希望能给大家一些帮助 ...

  9. JQuery EasyUI框架

    1. JQuery EasyUI框架概述 1.1. JQuery EasyUI是什么东西 答:JQuery  EasyUI就是一套基础JQuery的富客户端的UI框架.像这些将常用的控件封装成一个UI ...

  10. Netty服务端创建流程及组件职责

    public class NettyServer { public static void main(String[] args) throws InterruptedException { NioE ...