tensorflow源码安装
2016-05-03 15:54
155 查看
安装环境
ubuntu14.04安装java8
$ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer
安装其他的一些工具
apt-get install pkg-config zip g++ zlib1g-dev unzip
安装Bazel
下载安装包$ chmod +x bazel-version-installer-os.sh $ ./bazel-version-installer-os.sh --zhangjl
安装其他需要的环境
sudo apt-get install python-numpy swig python-dev python-wheel
配置参数
$ ./configure Please specify the location of python. [Default is /usr/bin/python]: Do you wish to build TensorFlow with GPU support? [y/N] y GPU support will be enabled for TensorFlow Please specify which gcc nvcc should use as the host compiler. [Default is /usr/bin/gcc]: /usr/bin/gcc-4.9 Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]: 7.5 Please specify the location where CUDA 7.5 toolkit is installed. Refer to README.md for more details. [default is: /usr/local/cuda]: /usr/local/cuda Please specify the Cudnn version you want to use. [Leave empty to use system default]: 4.0.4 Please specify the location where the cuDNN 4.0.4 library is installed. Refer to README.md for more details. [default is: /usr/local/cuda]: /usr/local/cudnn-r4-rc/ Please specify a list of comma-separated Cuda compute capabilities you want to build with. You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Please note that each additional compute capability significantly increases your build time and binary size. [Default is: \"3.5,5.2\"]: 3.5 Setting up Cuda include Setting up Cuda lib64 Setting up Cuda bin Setting up Cuda nvvm Setting up CUPTI include Setting up CUPTI lib64 Configuration finished
编译之后词gpu的版本
$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer $ bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu # Lots of output. This tutorial iteratively calculates the major eigenvalue of # a 2x2 matrix, on GPU. The last few lines look like this. 000009/000005 lambda = 2.000000 x = [0.894427 -0.447214] y = [1.788854 -0.894427] 000006/000001 lambda = 2.000000 x = [0.894427 -0.447214] y = [1.788854 -0.894427] 000009/000009 lambda = 2.000000 x = [0.894427 -0.447214] y = [1.788854 -0.894427] Note that "--config=cuda" is needed to enable the GPU support
注意事项
Although it is possible to build both Cuda and non-Cuda configs under the same source tree, we recommend to run bazel clean when switching between these two configs in the same source tree.You have to run configure before running bazel build. Otherwise, the build will fail with a clear error message. In the future, we might consider making this more convenient by including the configure step in our build process.
相关文章推荐
- android操作xml
- HTML&CSS——对背景图定位中background-position属性的自我理解
- Java集合和树
- 线程优先级与线程安全
- 超链接无效
- ztr loves lucky numbers--hdu5676(DFS)
- VC++6.0在win8.1系统下的兼容性破解
- 关于毫秒数转date类型的细节问题
- Android WebView使用基础
- 如何升级nodejs版本
- C语言文件读写操作中缓冲区问题和setbuf函数详解
- hiho第九十二周数论一·Miller-Rabin质数测试
- oracle创建计划任务
- Web程序员最常用的11款PHP框架
- 猜数字(C语言版)
- 停博通知
- BLE4.0 连接参数说明和使用
- Jetty 的工作原理以及与 Tomcat 的比较
- 第8条 对于所有对象都通用的方法——覆盖equals时请遵守通用约定
- vm10虚拟机安装Mac OS X10.10教程