TensorFlow的安装方式有多种,包括Anaconda安装,方法如下:
1. 安装Anaconda
2. 创建一个叫做tensorflow的conda环境
# Python 2.7
$ conda create -n tensorflow python=2.7
3. 激活conda环境,用pip在该环境里安装TensorFlow
$ source activate tensorflow (tensorflow)$ # Your prompt should change # Ubuntu/Linux 64-bit, CPU only, Python 2.7: (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7. Requires CUDA toolkit 7.5 and CuDNN v4. # For other versions, see "Install from sources" below. (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl # Mac OS X, CPU only: (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl
4. conda环境激活后,就可以测试tensorflow是否安装成功了。
5. 用完tensorflow后,关闭环境。
(tensorflow)$ source deactivate $ # Your prompt should change back6. 再次需要使用tensorflow时,再激活环境。
$ source activate tensorflow (tensorflow)$ # Your prompt should change. # Run Python programs that use TensorFlow. ... # When you are done using TensorFlow, deactivate the environment. (tensorflow)$ source deactivate
转自 https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#test-the-tensorflow-installation
445

被折叠的 条评论
为什么被折叠?



