tensorflow编译和Eigen3不兼容报错解决 -- error: the value of ‘j’ is not usable in a constant expression

编译tensorflow动态库的过程真的是万分曲折,版本搭配不对就会出错,报错信息如下:

error: the value of ‘j’ is not usable in a constant expression

定位到是Eigen3的问题,tensorflow版本是1.13.1,一般来说当需要安装第三方包的时候就在tensorflow/workspace.bzl中找类似下面的内容,然后按照连接下载即可,但是这次我用这个方法还是不行。

  tf_http_archive(
        name = "eigen_archive",
        build_file = clean_dep("//third_party:eigen.BUILD"),
        sha256 = "753fbb58d0a49b6bcbcfb126ebfa2e21fc97f7471529ba835a096008ce588d8a",
        strip_prefix = "eigen-eigen-9f48e814419e",
        urls = [
            "https://mirror.bazel.build/bitbucket.org/eigen/eigen/get/9f48e814419e.tar.gz",
            "https://bitbucket.org/eigen/eigen/get/9f48e814419e.tar.gz",
        ],

最终在github上看到了一句话 https://github.com/tensorflow/tensorflow/issues/29927

I had the same issue
I resolved it by manually downloading the eigen v 3.3.7 (last stable)

按照这里说的下载Eigen3.3.7版本源码,在源码目录中执行下面的命令

mkdir build
cd build
cmake ..
sudo make install

然后把/usr/local/include/eigen3加入Makefile的include路径即可解决编译tensorflow1.13.1中的报错。

另外可以在Eigen/src/Core/util/Macros.h 查看Eigen的版本号。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值