您现在的位置是:主页 > news > 长沙精品网站建设公司/注册公司网上申请入口

长沙精品网站建设公司/注册公司网上申请入口

admin2025/4/18 14:54:03news

简介长沙精品网站建设公司,注册公司网上申请入口,台州品牌网站设计,政府网站建设管理会议主持词6ubuntu系统安装tensorflow 一、【前言】 前几天一直折腾源码编译安装tensorflow,费力不讨好,还是现成的轮子好用。特此记录下来安装过程。 二、准备工作 环境准备: 1、ubuntu14.04系统(虚拟机) 2、python 3.4.3 …

长沙精品网站建设公司,注册公司网上申请入口,台州品牌网站设计,政府网站建设管理会议主持词6ubuntu系统安装tensorflow 一、【前言】 前几天一直折腾源码编译安装tensorflow,费力不讨好,还是现成的轮子好用。特此记录下来安装过程。 二、准备工作 环境准备: 1、ubuntu14.04系统(虚拟机) 2、python 3.4.3 …

                                            ubuntu系统安装tensorflow

一、【前言】

前几天一直折腾源码编译安装tensorflow,费力不讨好,还是现成的轮子好用。特此记录下来安装过程。

二、准备工作

环境准备:

                1、ubuntu14.04系统(虚拟机)

                2、python 3.4.3   //安装过numpy和six

                3、下载好tensorflow轮子,地址:https://pypi.org/project/tensorflow/#files

问题:

               1、python安装six时有告警信息

                test@ubuntu:~$ sudo pip3 install six

告警信息:

The directory '/home/test/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/test/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

 解决办法:

test@ubuntu:~$ sudo -H pip3 install six

三、安装tensorflow过程

 1、安装命令

test@ubuntu:~$ sudo -H pip3 install https://files.pythonhosted.org/packages/69/90/357f5f0e7da99bc314f84f01922d95f3d52b008ec3f70558886b14639820/tensorflow-1.10.1-cp34-cp34m-manylinux1_x86_64.whl

   1)出错信息

Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

    2)解决办法

         命令行后边添上 --ignore-installed six

sudo -H pip3 install https://files.pythonhosted.org/packages/69/90/357f5f0e7da99bc314f84f01922d95f3d52b008ec3f70558886b14639820/tensorflow-1.10.1-cp34-cp34m-manylinux1_x86_64.whl --ignore-installed six

 2、安装成功,小试牛刀

test@ubuntu:~$ python
Python 3.4.3 (default, Nov 28 2017, 16:41:13) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> t0 = tf.constant(3, dtype=tf.int32)
>>> t1 = tf.constant([3., 4.1, 5.2], dtype=tf.float32)
>>> t2 = tf.constant([['Apple', 'Orange'], ['Potato', 'Tomato']], dtype=tf.string)
>>> t3 = tf.constant([[[5], [6], [7]], [[4], [3], [2]]])
>>> print(t0)
Tensor("Const:0", shape=(), dtype=int32)
>>> print(t1)
Tensor("Const_1:0", shape=(3,), dtype=float32)
>>> print(t2)
Tensor("Const_2:0", shape=(2, 2), dtype=string)
>>> print(t3)
Tensor("Const_3:0", shape=(2, 3, 1), dtype=int32)
>>>