Tensorflow从源代码建立不再更快的再培训?
问题描述:
2015年初,我一直在我可爱的MBP上运行Tensorflow,仅限CPU。 我决定与Bazel一起构建一个Tensorflow版本,以加快速度:SSE4.1,SSE4.2,AVX,AVX2和FMA。Tensorflow从源代码建立不再更快的再培训?
bazel build --copt=-march=native //tensorflow/tools/pip_package:build_pip_package
但是,使用新安装再培训Inception v3模型不会更快,它使用完全相同的时间量。 这很奇怪,因为在训练的启动模型中进行推理时,速度提高了12%。培训MNIST的例子要快30%。
那么我们是否有可能在再培训中获得任何速度优势?
我也做了一个巴泽尔建立一个像解释here,同样的结果。
我的./configure:
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: Users/Gert/Envs/t4/bin/python3
Invalid python path. Users/Gert/Envs/t4/bin/python3 cannot be found
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: ls
Invalid python path. ls cannot be found
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: lslss
Invalid python path. lslss cannot be found
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: /rt/Envs/t4/bin/python3^C
(t4) Gerts-MacBook-Pro:tensorflow root#
(t4) Gerts-MacBook-Pro:tensorflow root# ./configure
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: /Users/Gert/Envs/t4/bin/python3
Please specify optimization flags to use during compilation [Default is -march=native]:
Do you wish to use jemalloc as the malloc implementation? (Linux only) [Y/n] n
jemalloc disabled on Linux
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] n
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/N] n
No Hadoop File System support will be enabled for TensorFlow
Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] n
No XLA JIT support will be enabled for TensorFlow
Found possible Python library paths:
/Users/Gert/Envs/t4/lib/python3.4/site-packages
Please input the desired Python library path to use. Default is [/Users/Gert/Envs/t4/lib/python3.4/site-packages]
Using python library path: /Users/Gert/Envs/t4/lib/python3.4/site-packages
Do you wish to build TensorFlow with OpenCL support? [y/N] n
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] n
No CUDA support will be enabled for TensorFlow
Configuration finished
感谢,
格特
答
的MNIST例如花费大量的时间矩阵产品内部。另一方面,典型的CNN在卷积中花费大部分时间。据我所知,TF使用Eigen作为CPU上的矩阵产品,这是非常优化的,以及你看到明显加速的原因。
如果我的信息是最新的,那么CPU上的卷积并不是最优化的。他们浪费时间复制数据,所以可以通过矩阵乘法来处理。所以,后者加速时影响不大。
完全连接MNIST或conv? – MaxB
这一个:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax.py – GMath