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

For macOS X/Linux variants

The following code snippet creates a Python virtual environment and installs TensorFlow in that environment. You should have Anaconda installed before you run this code:

#Creates a virtual environment named "tensorflow_env" assuming that python 3.7 version is already installed.
conda create -n tensorflow_env python=3.7
#Activate points to the environment named "tensorflow" source activate tensorflow_env conda install pandas matplotlib jupyter notebook scipy scikit-learn
#installs latest tensorflow version into environment tensorflow_env pip3 install tensorflow

Please check out the latest updates on the official TensorFlow page, https://www.tensorflow.org/install/.

Try running the following code in your Python console to validate your installation. The console should print Hello World! if TensorFlow is installed and working:

import tensorflow as tf

#Creating TensorFlow object 
hello_constant = tf.constant('Hello World!', name = 'hello_constant')
#Creating a session object for execution of the computational graph
with tf.Session() as sess:
    #Implementing the tf.constant operation in the session
    output = sess.run(hello_constant)
    print(output)
主站蜘蛛池模板: 论坛| 青州市| 南皮县| 堆龙德庆县| 翁牛特旗| 本溪市| 汉沽区| 南郑县| 淮滨县| 内丘县| 岳阳县| 罗源县| 桃园县| 济源市| 新巴尔虎右旗| 滦南县| 遂平县| 永兴县| 奉节县| 伊宁市| 岢岚县| 建瓯市| 遂昌县| 双江| 长宁区| 临邑县| 广汉市| 大渡口区| 广平县| 康保县| 达拉特旗| 广德县| 绩溪县| 车险| 隆德县| 酒泉市| 丹寨县| 福贡县| 浑源县| 土默特右旗| 巧家县|