重新编译tensorflow源代码遇见的问题解决方法

今天试了一下tensorflow自定义op,在tensorflow源代码下创建一个自己的op后需要重新编译tensorflow,但是我这次编译出现了如下所示的错误:
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_3kcompat.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/ufunc_api.txt’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/arrayscalars.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/noprefix.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/utils.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/ufuncobject.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_endian.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/ndarrayobject.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_cpu.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_no_deprecated_api.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/multiarray_api.txt’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/_numpyconfig.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/old_defines.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/__ufunc_api.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/__multiarray_api.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_interrupt.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_1_7_deprecated_api.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/halffloat.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/_neighborhood_iterator_imp.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_common.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/ndarraytypes.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/numpyconfig.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_os.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/npy_math.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/arrayobject.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: declared output ‘external/local_config_python/numpy_include/numpy/oldnumeric.h’ is a dangling symbolic link.
ERROR: /home/torstein/.cache/bazel/_bazel_torstein/1f82ba256daa7468e9c0a1514e0b9aa5/external/local_config_python/BUILD:143:1: not all outputs were created or valid.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use –verbose_failures to see the command lines of failed build steps.

解决方案如下:
如果你装的是pip3请输入如下3个指令。
sudo pip3 install –no-cache-dir –upgrade –force-reinstall –user numpy
sudo pip3 install –no-cache-dir –upgrade –force-reinstall numpy
sudo rm -rf /home/[usrname]/.cache

如果你装的是pip请输入如下3个指令。
sudo pip install –no-cache-dir –upgrade –force-reinstall –user numpy
sudo pip install –no-cache-dir –upgrade –force-reinstall numpy
sudo rm -rf /home/[usrname]/.cache

然后开始重新编译!具体如何编译请看我上一篇文章https://blog.csdn.net/c3255/article/details/82385939

你可能感兴趣的:(深度学习环境配置)