本文介绍使用virtualenv虚拟的方式搭建Tensorflow。
- 1,安装Homebrew (brew):
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
- 2,通过brew安装python、Pip:
brew install python
sudo apt-get install python-setuptools
sudo easy_install pip
- 3,安装virtualenv:
sudo pip install –upgrade virtualenv
virtualenv –system-site-packages SOME_PATH/SOME_FOLDER
- 4,进入虚拟目录,并激活:
cd /SOME_REALLY_LONG_PATH/SOME_FOLDER
source bin/activate
deactivate
- 5,安装Tensorflow,python3,cpu版本:
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py3-none-any.whl
- 6,安装Keras。
进入虚拟环境,执行:
(gradEye_tf) CraigMac:gradEye_tf craig$ pip3 install keras