TensorFlow-安装

TensorFlow-安装 (TensorFlow - Installation)

To install TensorFlow, it is important to have “Python” installed in your system. Python version 3.4+ is considered the best to start with TensorFlow installation.

要安装TensorFlow,在系统中安装“ Python”非常重要。 从TensorFlow安装开始,Python 3.4+被认为是最好的选择。

Consider the following steps to install TensorFlow in Windows operating system.

考虑以下步骤在Windows操作系统中安装TensorFlow。

Step 1 − Verify the python version being installed.

步骤1-验证正在安装的python版本。

Python Version Installed

Step 2 − A user can pick up any mechanism to install TensorFlow in the system. We recommend “pip” and “Anaconda”. Pip is a command used for executing and installing modules in Python.

步骤2-用户可以选择任何机制在系统中安装TensorFlow。 我们建议使用“点子”和“ Anaconda”。 Pip是用于在Python中执行和安装模块的命令。

Before we install TensorFlow, we need to install Anaconda framework in our system.

在安装TensorFlow之前,我们需要在系统中安装Anaconda框架。

Install Anaconda

After successful installation, check in command prompt through “conda” command. The execution of command is displayed below −

成功安装后,通过“ conda”命令检入命令提示符。 命令的执行如下所示-

Conda Command Execution

Step 3 − Execute the following command to initialize the installation of TensorFlow −

步骤3-执行以下命令以初始化TensorFlow的安装-


conda create --name tensorflow python = 3.5

Installation of TensorFlow

It downloads the necessary packages needed for TensorFlow setup.

它下载TensorFlow设置所需的必要软件包。

Step 4 − After successful environmental setup, it is important to activate TensorFlow module.

步骤4-成功设置环境后,激活TensorFlow模块很重要。


activate tensorflow

Environmental Setup

Step 5 − Use pip to install “Tensorflow” in the system. The command used for installation is mentioned as below −

步骤5-使用pip在系统中安装“ Tensorflow”。 用于安装的命令如下所述-


pip install tensorflow

And,

和,


pip install tensorflow-gpu

Pip To Install
Pip To Install TensorFlow

After successful installation, it is important to know the sample program execution of TensorFlow.

成功安装后,了解TensorFlow的示例程序执行非常重要。

Following example helps us understand the basic program creation “Hello World” in TensorFlow.

以下示例可帮助我们了解TensorFlow中的基本程序创建“ Hello World”。

Hello World Example

The code for first program implementation is mentioned below −

下面提到了第一个程序实现的代码-


>> activate tensorflow
>> python (activating python shell)
>> import tensorflow as tf
>> hello = tf.constant(‘Hello, Tensorflow!’)
>> sess = tf.Session()
>> print(sess.run(hello))

翻译自: https://www.tutorialspoint.com/tensorflow/tensorflow_installation.htm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值