Tensorflow 安装

发布时间: 更新时间: 总字数:75 阅读时间:1m 作者: IP属地: 分享 复制网址

Tensorflow 安装

pip

TensorFlow 2

pip install --upgrade pip
pip install tensorflow
pip install tf-nightly

说明:

  • pip >= 19.0

TensorFlow 1.x

# CPU 版本
tensorflow==1.15

# GPU 版本
tensorflow-gpu==1.15

conda

conda install tensorflow-gpu==1.15.0

Docker

docker pull tensorflow/tensorflow:latest  # Download latest stable image
docker run -it -p 8888:8888 tensorflow/tensorflow:latest-jupyter  # Start Jupyter server

demo

  • hello.py
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(hello))
  • 执行
python hello.py

参考

  1. https://tensorflow.google.cn/
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数