- 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!
推薦閱讀
- 快學Flash動畫百例
- 觸控顯示技術(shù)
- 數(shù)據(jù)通信與計算機網(wǎng)絡
- 大數(shù)據(jù)時代
- Android游戲開發(fā)案例與關(guān)鍵技術(shù)
- 走近大數(shù)據(jù)
- 啊哈C!思考快你一步
- Flink原理與實踐
- 中文版AutoCAD 2013高手速成
- Linux系統(tǒng)下C程序開發(fā)詳解
- Hands-On Dashboard Development with QlikView
- 無人駕駛感知智能
- WPF專業(yè)編程指南
- 實戰(zhàn)大數(shù)據(jù)(Hadoop+Spark+Flink):從平臺構(gòu)建到交互式數(shù)據(jù)分析(離線/實時)
- 微計算機原理及應用