这篇文章给大家分享的是有关TensorFlow源代码编译构建安装包的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
git clone https://github.com/tensorflow/tensorflow.gitcd tensorflow
apt install curl gnupg curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg mv bazel.gpg /etc/apt/trusted.gpg.d/ echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
pip install six numpy wheel setuptools mock 'future>=0.17.1' pip install keras_applications --no-deps pip install keras_preprocessing --no-deps
./configure
Please specify the location of python. [Default is /root/miniconda3/envs/ray/bin/python3]:
Found possible Python library paths: /root/miniconda3/envs/ray/lib/python3.8/site-packages Please input the desired Python library path to use. Default is [/root/miniconda3/envs/ray/lib/python3.8/site-packages]
Do you wish to build TensorFlow with ROCm support? [y/N]: N
Do you wish to build TensorFlow with CUDA support? [y/N]: N
Do you wish to download a fresh release of clang? (Experimental) [y/N]: N
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]:
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: N
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install tensorflow-2.5.0-cp38-cp38-linux_x86_64.whl
感谢各位的阅读!关于“TensorFlow源代码编译构建安装包的示例分析”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。