tensorflow与numpy的版本兼容性问题的解决
程序员文章站
2022-03-27 11:48:08
在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版本兼容性内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
上一篇: selenium+headless chrome爬虫的实现示例
下一篇: Android从源码分析handler.post(runnable),view.post(runnable),runOnUiThread(runnable)执行时机
推荐阅读
-
ECshop 迁移到 PHP7版本时遇到的兼容性问题_PHP
-
解决IE5/IE5.5/IE6/FF的兼容性问题——CSS
-
PHP版本的选择5.2.17 5.3.27 5.3.28 5.4 5.5兼容性问题分析
-
WPF中不规则窗体与WindowsFormsHost控件兼容问题的解决方法
-
WPF中不规则窗体与WindowsFormsHost控件兼容问题的解决方法
-
IE11怎么降级到IE10解决升级IE11之后的兼容性问题
-
关于HTML5 Placeholder新标签低版本浏览器下不兼容的问题分析及解决办法
-
ECshop 迁移到 PHP7版本时遇到的兼容性问题
-
IE11怎么降级到IE10解决升级IE11之后的兼容性问题
-
显卡和主板不兼容的原因小结与解决方法