重新编译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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值