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

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)
主站蜘蛛池模板: 宾川县| 历史| 万载县| 陇南市| 那曲县| 正宁县| 汶上县| 汾西县| 神农架林区| 天柱县| 阜南县| 崇州市| 永宁县| 无为县| 龙川县| 永德县| 琼结县| 桓仁| 海晏县| 荣昌县| 英德市| 高青县| 东丽区| 仁寿县| 九江市| 辽源市| 遂宁市| 黄骅市| 甘孜县| 瑞金市| 金寨县| 和平区| 永定县| 临江市| 津市市| 共和县| 阿拉善右旗| 老河口市| 扶沟县| 商河县| 黎川县|