代码之家  ›  专栏  ›  技术社区  ›  isaacsultan

Tensorflow贡献后的Bazel构建和测试

  •  0
  • isaacsultan  · 技术社区  · 7 年前

    tensorflow/tensorflow/python/ops/image_ops_impl.py 以及相应的单元测试 tensorflow/tensorflow/python/ops/image_ops_test.py

    我最初从 master branch,在我的本地计算机上做了这些更改,重新定位并提交。

    运行时 bazel test //tensorflow/python...

    ERROR: /Users/isaacsultan/Code/tensorflow/third_party/python_runtime/BUILD:5:1: no such package '@local_config_python//': Traceback (most recent call last):
        File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 308
            _create_local_python_repository(repository_ctx)
        File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 270, in _create_local_python_repository
            _check_python_lib(repository_ctx, python_lib)
        File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 213, in _check_python_lib
            _fail(("Invalid python library path: %...))
        File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 28, in _fail
            fail(("%sPython Configuration Error:%...)))
    Python Configuration Error: Invalid python library path: /usr/local/lib/python2.7/dist-packages
     and referenced by '//third_party/python_runtime:headers'
    ERROR: Analysis of target '//tensorflow/python:control_flow_util' failed; build aborted: Analysis failed
    INFO: Elapsed time: 4.603s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (8 packages loaded)
    FAILED: Build did NOT complete successfully (8 packages loaded)
        currently loading: tensorflow/core ... (2 packages)
    

    请问我的问题的根源是什么?

    因为我只改变了python的功能,所以不需要重新构建。

    编辑:重新运行后 ./configure

    (tensorflow) Isaacs-MacBook:tensorflow isaacsultan$ bazel clean --expunge
    INFO: Starting clean.
    (tensorflow) Isaacs-MacBook:tensorflow isaacsultan$ bazel test //tensorflow/python/...
    Starting local Bazel server and connecting to it...
    ........................
    ERROR: /private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/external/local_config_cc/BUILD:50:5: in apple_cc_toolchain rule @local_config_cc//:cc-compiler-darwin_x86_64: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, try: "bazel clean --expunge" to re-run Xcode configuration
    ERROR: Analysis of target '//tensorflow/python/eager:core' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler-darwin_x86_64' failed; build aborted
    INFO: Elapsed time: 15.184s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (93 packages loaded)
    FAILED: Build did NOT complete successfully (93 packages loaded)
        currently loading: tensorflow/core ... (2 packages)
    

    编辑2:

    bazel clean --expunge 然后 :

    Isaacs-MacBook:Tensorflow isaacsultan$ bazel test //tensorflow/python/...
    Starting local Bazel server and connecting to it...
    ...................
    ERROR: /private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/external/local_config_cc/BUILD:50:5: in apple_cc_toolchain rule @local_config_cc//:cc-compiler-darwin_x86_64: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, try: "bazel clean --expunge" to re-run Xcode configuration
    ERROR: Analysis of target '//tensorflow/python:pywrap_tensorflow_import_lib_file' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler-darwin_x86_64' failed; build aborted
    INFO: Elapsed time: 14.969s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (88 packages loaded)
    FAILED: Build did NOT complete successfully (88 packages loaded)
        currently loading: tensorflow/core ... (5 packages)
    

    执行以下步骤后: Xcode version must be specified to use an Apple CROSSTOOL

    4 warnings generated.
    ERROR: /Users/isaacsultan/Code/tensorflow/tensorflow/BUILD:576:1: Executing genrule //tensorflow:tensorflow_python_api_gen failed (Exit 1)
    /anaconda/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
      from ._conv import register_converters as _register_converters
    Traceback (most recent call last):
      File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 27, in <module>
        from tensorflow.python.tools.api.generator import doc_srcs
      File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 81, in <module>
        from tensorflow.python import keras
      File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/keras/__init__.py", line 25, in <module>
        from tensorflow.python.keras import applications
      File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/keras/applications/__init__.py", line 21, in <module>
        import keras_applications
    ImportError: No module named keras_applications
    INFO: Elapsed time: 57510.356s, Critical Path: 492.10s
    INFO: 6867 processes: 6867 local.
    FAILED: Build did NOT complete successfully
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   gunan    7 年前

    你可能忘了跑步 ./configure 在建造之前?