tensorflow 1.15编译

tensorflow真的是烂,build from source一堆死链接死依赖,官方连自己release版本的availability都不管,难怪弃坑的人越来越多

先改这几个文件

thw@thw-s5:~/code/tf-gitee/tensorflow$ git diff
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index 84b2bdcb2d..615d8c3cc3 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -135,11 +135,14 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
     tf_http_archive(
         name = "mkl_dnn",
         build_file = clean_dep("//third_party/mkl_dnn:mkldnn.BUILD"),
-        sha256 = "74675e93eef339ff3d9a9be95c15d0c7ad8736a5356c23428ab2e33dcdb8e3e1",
-        strip_prefix = "mkl-dnn-0.20.6",
+        #sha256 = "74675e93eef339ff3d9a9be95c15d0c7ad8736a5356c23428ab2e33dcdb8e3e1",
+        sha256 = "f1de676fddeb94132c5ae480fb03a64f03deda10b09b3141373f2b2fe5cd031d",
+        #strip_prefix = "mkl-dnn-0.20.6",
+        strip_prefix = "oneDNN-0.20.6",
         urls = [
             "https://storage.googleapis.com/mirror.tensorflow.org/github.com/intel/mkl-dnn/archive/v0.20.6.tar.gz",
             "https://github.com/intel/mkl-dnn/archive/v0.20.6.tar.gz",
+            "https://github.com/oneapi-src/oneDNN/archive/v0.20.6.tar.gz",
         ],
     )
 
@@ -409,9 +412,11 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
         name = "org_python_license",
         licenses = ["notice"],  # Python 2.0
         sha256_urls = {
-            "e76cacdf0bdd265ff074ccca03671c33126f597f39d0ed97bc3e5673d9170cf6": [
-                "https://storage.googleapis.com/mirror.tensorflow.org/docs.python.org/2.7/_sources/license.rst.txt",
-                "https://docs.python.org/2.7/_sources/license.rst.txt",
+            #"e76cacdf0bdd265ff074ccca03671c33126f597f39d0ed97bc3e5673d9170cf6": [
+            "b5556e921715ddb9242c076cae3963f483aa47266c5e37ea4c187f77cc79501c": [
+                #"https://storage.googleapis.com/mirror.tensorflow.org/docs.python.org/2.7/_sources/license.rst.txt",
+                #"https://docs.python.org/2.7/_sources/license.rst.txt",
+                "https://mirror.bazel.build/docs.python.org/2.7/_sources/license.txt",
             ],
         },
     )

 

编译脚本

bazel build --config=opt \
            --config=cuda \
            --config=nonccl \
            --config=nokafka \
            --config=noaws \
            --config=nogcp \
            --config=nohdfs \
            --config=noignite \
            --jobs 6 \
            //tensorflow/tools/pip_package:build_pip_package

 

总算是编译过了

如果不加noxxx那一坨,就会遇到更多死链接 

你可能感兴趣的:(tensorflow 1.15编译)