- Keras Deep Learning Cookbook
- Rajdeep Dua Manpreet Singh Ghotra
- 210字
- 2021-06-10 19:38:47
Installing TensorFlow
- Execute the following command to install tensorflow using conda:
conda install -c conda-forge tensorflow
The output of this command will fetch metadata and install a list of packages, as follows:
Fetching package metadata .............
Solving package specifications: .
Package plan for installation in environment /home/ubuntu/miniconda2:
- The following new packages will also be installed:
bleach: 1.5.0-py27_0 conda-forge
funcsigs: 1.0.2-py_2 conda-forge
futures: 3.2.0-py27_0 conda-forge
html5lib: 0.9999999-py27_0 conda-forge
markdown: 2.6.9-py27_0 conda-forge
mock: 2.0.0-py27_0 conda-forge
pbr: 3.1.1-py27_0 conda-forge
protobuf: 3.5.0-py27_0 conda-forge
tensorboard: 0.4.0rc3-py27_0 conda-forge
tensorflow: 1.4.0-py27_0 conda-forge
webencodings: 0.5-py27_0 conda-forge
werkzeug: 0.12.2-py_1 conda-forge
- A higher-priority channel will supersede the following packages, as follows:
conda: 4.3.30-py27h6ae6dc7_0 --> 4.3.29-py27_0 conda-forge
conda-env: 2.6.0-h36134e3_1 --> 2.6.0-0 conda-forge
Proceed ([y]/n)? y
conda-env-2.6. 100% |#############################################################| Time: 0:00:00 1.67 MB/s
...
mock-2.0.0-py2 100% |#############################################################| Time: 0:00:00 26.00 MB/s
conda-4.3.29-p 100% |#############################################################| Time: 0:00:00 27.46 MB/s
- Once TensorFlow has been installed, let's test it with a simple program. Create a new file called hello_tf.py with the following command:
vi hello_tf.py
- Add the following code to this file and save the file:
import tensorflow as tf
hello = tf.constant('Greetings, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
- Execute the file created from the command line:
python hello_tf.py
The output will make sure the library has been successfully installed:
Greetings, TensorFlow!
推薦閱讀
- Ansible Configuration Management
- 現代測控系統典型應用實例
- 精通MATLAB神經網絡
- PostgreSQL 11 Server Side Programming Quick Start Guide
- Getting Started with Clickteam Fusion
- 精通Windows Vista必讀
- 條碼技術及應用
- 自動生產線的拆裝與調試
- 3D Printing for Architects with MakerBot
- RPA(機器人流程自動化)快速入門:基于Blue Prism
- Mastering Game Development with Unreal Engine 4(Second Edition)
- 內模控制及其應用
- 電子設備及系統人機工程設計(第2版)
- TensorFlow Deep Learning Projects
- Effective Business Intelligence with QuickSight