官术网_书友最值得收藏!

  • Keras Deep Learning Cookbook
  • Rajdeep Dua Manpreet Singh Ghotra
  • 210字
  • 2021-06-10 19:38:47

Installing TensorFlow

  1. 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:
  1. 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
  1. 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
  1. 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
  1. 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))
  1. 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!
主站蜘蛛池模板: 维西| 封开县| 紫金县| 蕲春县| 新巴尔虎左旗| 平顶山市| 县级市| 阳泉市| 枣阳市| 镇雄县| 东源县| 连江县| 绥棱县| 上林县| 桂阳县| 临泉县| 宝坻区| 福贡县| 灯塔市| 剑河县| 宜良县| 通化县| 天等县| 姜堰市| 博爱县| 梓潼县| 突泉县| 扎兰屯市| 兴安县| 南川市| 柳河县| 大渡口区| 临安市| 丹阳市| 盐津县| 阿克陶县| 固始县| 武威市| 青浦区| 岚皋县| 博湖县|