下载tensorflow: git clone https://github.com/tensorflow/tensorflow 安装python依赖库: sudo apt-get install python-numpy python-dev python-pip python-wheel如果是安装tensorflow for python3,则为: sudo apt-get install python3-numpy python3-dev python3-pip python3-wheel要实现GPU计算,还需要安装cuda,cudnn,安装步骤可参考:http://blog.csdn.net/u011961856/article/details/76723285 安装libcupti-dev: sudo apt-get install libcupti-dev 安装bazel: https://docs.bazel.build/versions/master/install.html 进入tensorflow目录 cd tensorflow 运行configure: ./configure 编译pip 安装包: cpu: sudo bazel build --config=opt //tensorflow/tools/pip_package:build_pip_packagegpu sudo bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package 生成pip安装包,.whl文件: sudo bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg进入目录/tmp/tensorflow_pkg,并查看生成的.whl文件: cd /tmp/tensorflow_pkgls查询发现生成的安装包名为: tensorflow-1.3.0rc1-cp27-cp27mu-linux_x86_64.whl pip安装tensorflow for python2: sudo pip2 install tensorflow-1.3.0rc1-cp27-cp27mu-linux_x86_64.whlpip安装tensorflow for python3: sudo pip3 install tensorflow-1.3.0rc1-cp27-cp27mu-linux_x86_64.whl测试是否安装成功: import tensorflow成功,说明安装成功.
【转载】 https://blog.csdn.net/u011961856/article/details/76725411
|