制作可编译Tensorflow二进制文件以使用的Dockerfile:SSE4.1,SSE4.2和AVX指令 [英] Make a Dockerfile that compiles a Tensorflow binary to use: SSE4.1, SSE4.2 and AVX instructions

查看:184
本文介绍了制作可编译Tensorflow二进制文件以使用的Dockerfile:SSE4.1,SSE4.2和AVX指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,docker的目的之一就是轻松部署环境来测试软件,对吗?有人可以告诉我如何在Docker文件上编译Tensorflow二进制文件以使用:SSE4.1,SSE4.2吗?谁能指出我这样做的码头工人文件?如果有可能吗?



总而言之,有两个问题:




  • 是否可能有码头工人编译Tensorflow二进制文件以使用的文件:SSE4.1,SSE4.2(和GPU,我只找到一个或另一个)

  • 能告诉我在哪里可以找到码头工人吗?这样做的文件还是不错的教程?



此问题的目的是避免出现以下情况:主机设置工作正常,但Docker设置不起作用,因为Tensorflow并非以特定方式编译。 如下图所示。

解决方案

可以将此类Dockerfile用作起点的工作示例:> https://github.com/tensorflow/tensorflow/tree/mast er / tensorflow / tools / docker (有关详细信息,请参见 README.md )。



更准确,它是一组参数化的Docker文件,构建从 parameterized_docker_build.sh 开始。成功在Docker内部编译TensorFlow的命令示例为:

  export TF_DOCKER_BUILD_IS_DEVEL = YES 
export TF_DOCKER_BUILD_TYPE = CPU
出口TF_DOCKER_BUILD_PYTHON_VERSION = PYTHON3
出口TF_DOCKER_BUILD_DEVEL_BRANCH = master
tensorflow / tools / docker / parameterized_docker_build.sh

出于构建带有自定义标志的TensorFlow的目的,请使用 TF_DOCKER_BUILD_IS_DEVEL = YES ,因为非开发版Docker文件仅从服务器下载预编译的Docker二进制文件。 p>

TensorFlow团队刚刚开始构建开发Docker映像



对于SSE 看到此问题。您可以在 https的本地副本中修改bazel命令行。 ://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel



PS。对于具有自定义选项的非开发TensorFlow构建,您可以查看 https:/ /github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/ci_build


So, one of the porpuses of docker is to easily deploy an environment to test software right? Can anybody tell me how to compile a Tensorflow binary to use: SSE4.1, SSE4.2 on a docker file?. Can anybody point me to a docker file that does that? if it is possible at all?

In summary, two questions:

  • Is it possible to have a docker file that compiles a Tensorflow binary to use: SSE4.1, SSE4.2 (and GPU, I have only found one or the other)
  • Can you tell me where I can found a docker file that does that or a good tutorial?

"The purpose of this question is to avoid the following scenario: Where the host setup work but the docker set up doesn't work because Tensorflow was not compiled in a particular way." Like the image below.

解决方案

The working example of such Dockerfile that can be used as a starting point is there: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/docker (see README.md for details).

More accurately, it is a set of parameterized Docker files, the build is started with parameterized_docker_build.sh. An example of a command that successfully compiles TensorFlow inside Docker is:

export TF_DOCKER_BUILD_IS_DEVEL=YES
export TF_DOCKER_BUILD_TYPE=CPU
export TF_DOCKER_BUILD_PYTHON_VERSION=PYTHON3
export TF_DOCKER_BUILD_DEVEL_BRANCH=master
tensorflow/tools/docker/parameterized_docker_build.sh

For the purpose of building TensorFlow with custom flags use TF_DOCKER_BUILD_IS_DEVEL=YES as non-devel Docker files just downloads precompiled Docker binaries from the server.

TensorFlow team just started to build development Docker images with AVX recently.

For SSE see this question. You can modify bazel command line in your local copy of https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel.

PS. For non-devel TensorFlow build with custom options you could look at https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/ci_build.

这篇关于制作可编译Tensorflow二进制文件以使用的Dockerfile:SSE4.1,SSE4.2和AVX指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆