Tensorflow 安装技术专题与文档汇总,系统梳理 ai、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.15conda
conda install tensorflow-gpu==1.15.0Docker
docker pull tensorflow/tensorflow:latest # Download latest stable image
docker run -it -p 8888:8888 tensorflow/tensorflow:latest-jupyter # Start Jupyter serverdemo
- hello.py
import tensorflow as tf
# TensorFlow 2.x (默认 Eager Execution)
hello = tf.constant('Hello, TensorFlow!')
tf.print(hello)
# 若在 TensorFlow 1.x 环境下运行:
# sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# print(sess.run(hello))- 执行
python hello.py参考
最近更新
最新评论