tensorflow与numpy的版本兼容性问题的解决
程序员文章站
2022-07-03 13:12:24
在python交互式窗口导入tensorflow出现了下面的错误:root@ubuntu:~# python3 python 3.6.8 (default, oct 7 2019, 12:59:55)...
在python交互式窗口导入tensorflow出现了下面的错误:
root@ubuntu:~# python3 python 3.6.8 (default, oct 7 2019, 12:59:55) [gcc 8.3.0] on linux type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf; /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'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /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'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /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'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /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'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /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'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /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'. np_resource = np.dtype([("resource", np.ubyte, 1)]) /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'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /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'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /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'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /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'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /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'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /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'. np_resource = np.dtype([("resource", np.ubyte, 1)])
我的错误原因是numpy的版本较高造成的,换成1.14.0版本后解决了
出错时的numpy版本
root@ubuntu:~# pip3 show numpy name: numpy version: 1.17.3 summary: numpy is the fundamental package for array computing with python. home-page: https://www.numpy.org author: travis e. oliphant et al. author-email: none license: bsd location: /usr/local/lib/python3.6/dist-packages requires:
安装1.14.0的numpy版本
root@ubuntu:~# pip3 install numpy==1.14.0 collecting numpy==1.14.0 downloading https://files.pythonhosted.org/packages/dc/ac/5c270dffb864f23315e9c1f9e0a0b300c797b3c170666c031c4de42aacae/numpy-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (17.2mb) 100% |████████████████████████████████| 17.2mb 75kb/s installing collected packages: numpy successfully installed numpy-1.14.0 root@ubuntu:~# python3 python 3.6.8 (default, oct 7 2019, 12:59:55) [gcc 8.3.0] on linux type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf; >>> tf.__version__ '1.14.0' >>>
到此这篇关于tensorflow与numpy的版本兼容性问题的解决的文章就介绍到这了,更多相关tensorflow与numpy版本兼容性内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
下一篇: 金山文档小程序怎么建立多人协作编辑表格?
推荐阅读
-
IE11怎么降级到IE10解决升级IE11之后的兼容性问题
-
显卡和主板不兼容的原因小结与解决方法
-
LabVIEW2011能打开LabVIEW2016吗?LabVIEW不同版本之间的兼容性问题解答
-
如何解决hover在ie6中的兼容性问题
-
快速解决docker-py api版本不兼容的问题
-
完美解决axios在ie下的兼容性问题
-
编写同时兼容Python2.x与Python3.x版本的代码的几个示例
-
浅谈Tensorflow由于版本问题出现的几种错误及解决方法
-
win8系统安装冒险岛不兼容且提示“此程序存在已知兼容性问题”的解决方法
-
关于HTML5 Placeholder新标签低版本浏览器下不兼容的问题分析及解决办法