且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Docker从源代码构建Tensorflow

更新时间:2023-12-02 18:42:28

您所引用的文档似乎与图像的当前布局未对齐.安装tensorflow源的正确文件夹是/tensorflow_src .

It looks like the doc your referenced is not aligned with the current layout of the image. The correct folder where tensorflow sources are installed is /tensorflow_src.

只需在您的 docker run 命令行中更改选项=> -w/tensorflow_src (或在容器中一次 cd/tensorflow_src ),您应该立即可以拉出.

Just change the option in your docker run command line => -w /tensorflow_src (or cd /tensorflow_src once in the container), and you should immediately be able to pull.

我这边的测试

$ docker run -it --rm -w /tensorflow_src -v $PWD:/mnt -e HOST_PERMS="$(id -u):$(id -g)" tensorflow/tensorflow:devel bash

________                               _______________                
___  __/__________________________________  ____/__  /________      __
__  /  _  _ \_  __ \_  ___/  __ \_  ___/_  /_   __  /_  __ \_ | /| / /
_  /   /  __/  / / /(__  )/ /_/ /  /   _  __/   _  / / /_/ /_ |/ |/ / 
/_/    \___//_/ /_//____/ \____//_/    /_/      /_/  \____/____/|__/


WARNING: You are running this container as root, which can cause new files in
mounted volumes to be created as the root user on your host machine.

To avoid this, run the container by specifying your user's userid:

$ docker run -u $(id -u):$(id -g) args...

root@2f5660528e98:/tensorflow_src# git pull
remote: Enumerating objects: 7328, done.
remote: Counting objects: 100% (7328/7328), done.
remote: Total 12261 (delta 7328), reused 7328 (delta 7328), pack-reused 4933
Receiving objects: 100% (12261/12261), 8.59 MiB | 8.19 MiB/s, done.
Resolving deltas: 100% (10031/10031), completed with 2861 local objects.