Tensorflow macOS构建 - 库没有加载?

时间:2018-01-31 18:44:33

标签: python tensorflow

当我运行以下命令时:

bazel build --config=cuda --config=opt --copt=-msse4.2 --copt=-mpopcnt --copt=-maes --copt=-mcx16 --verbose_failures --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package --action_env PYTHON_BIN_PATH=/usr/bin/python

错误如下:

ERROR: /Users/psmith/tensorflow/tensorflow/contrib/tensor_forest/hybrid/BUILD:61:1: Executing genrule //tensorflow/contrib/tensor_forest/hybrid:training_ops_pygenrule failed (Aborted): bash failed: error executing command 
(cd /private/var/tmp/_bazel_psmith/740be14d2df868b3b127a540687eed16/execroot/org_tensorflow && \
exec env - \
CUDA_TOOLKIT_PATH=/usr/local/cuda \
CUDNN_INSTALL_PATH=/usr/local/cuda \
GCC_HOST_COMPILER_PATH=/usr/bin/gcc \
PATH=/Developer/NVIDIA/CUDA-9.1/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
PYTHON_BIN_PATH=/usr/bin/python \
PYTHON_LIB_PATH=/usr/local/bin/../Cellar/python3/3.6.4_2/bin/../Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages \
TF_CUDA_CLANG=0 \
TF_CUDA_COMPUTE_CAPABILITIES=6.1 \
TF_CUDA_VERSION=9.1 \
TF_CUDNN_VERSION=7 \
TF_NEED_CUDA=1 \
TF_NEED_OPENCL_SYCL=0 \
TMPDIR=/var/folders/cq/b_vr8w5s1613tvtx95l7d6880000gn/T/ \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/tensorflow/contrib/tensor_forest/hybrid/gen_training_ops_py_wrappers_cc , '\'''\'' 0 0 > bazel-out/darwin-py3-opt/genfiles/tensorflow/contrib/tensor_forest/hybrid/ops/gen_training_ops.py'): bash failed: error executing command 
(cd /private/var/tmp/_bazel_psmith/740be14d2df868b3b127a540687eed16/execroot/org_tensorflow && \
exec env - \
CUDA_TOOLKIT_PATH=/usr/local/cuda \
CUDNN_INSTALL_PATH=/usr/local/cuda \
GCC_HOST_COMPILER_PATH=/usr/bin/gcc \
PATH=/Developer/NVIDIA/CUDA-9.1/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
PYTHON_BIN_PATH=/usr/bin/python \
PYTHON_LIB_PATH=/usr/local/bin/../Cellar/python3/3.6.4_2/bin/../Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages \
TF_CUDA_CLANG=0 \
TF_CUDA_COMPUTE_CAPABILITIES=6.1 \
TF_CUDA_VERSION=9.1 \
TF_CUDNN_VERSION=7 \
TF_NEED_CUDA=1 \
TF_NEED_OPENCL_SYCL=0 \
TMPDIR=/var/folders/cq/b_vr8w5s1613tvtx95l7d6880000gn/T/ \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/tensorflow/contrib/tensor_forest/hybrid/gen_training_ops_py_wrappers_cc , '\'''\'' 0 0 > bazel-out/darwin-py3-opt/genfiles/tensorflow/contrib/tensor_forest/hybrid/ops/gen_training_ops.py')
dyld: Library not loaded: @rpath/libcudart.9.1.dylib
Referenced from: /private/var/tmp/_bazel_psmith/740be14d2df868b3b127a540687eed16/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/contrib/tensor_forest/hybrid/gen_training_ops_py_wrappers_cc
Reason: image not found
/bin/bash: line 1: 13798 Abort trap: 6           bazel-out/host/bin/tensorflow/contrib/tensor_forest/hybrid/gen_training_ops_py_wrappers_cc , '' 0 0 > bazel-out/darwin-py3-opt/genfiles/tensorflow/contrib/tensor_forest/hybrid/ops/gen_training_ops.py
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 0.909s, Critical Path: 0.06s
FAILED: Build did NOT complete successfully

但是,当我检查我的文件系统时,libcudart.9.1.dylib似乎确实位于正确的位置。

显然我是个菜鸟,我不确定@rpath是什么或为什么它无法看到正确的文件。有人能指出我正确的方向吗?

0 个答案:

没有答案