CasonTsai / MaskRcnn_tensorflow_cpp_inference

inference mask_rcnn model with tensorflow c++ api
MIT License
46 stars 10 forks source link

2 errors happened in compile with vs2015 #1

Open fit-gao opened 5 years ago

fit-gao commented 5 years ago

I have two errors when I compiled the prj with vs2015 like this, most problem is the function get_anchors, I do not know how to fix it,please help me, thanks: d:\tools\tensorflow-win\tensorflow\bazel-tensorflow\external\eigen_archive\unsupported\eigen\cxx11\src/Tensor/TensorExecutor.h(143): error C2440: “”: 无法从“const Eigen::DSizes<__int64,1>”转换为“TensorBlockDimensions” 1> d:\tools\tensorflow-win\tensorflow\bazel-tensorflow\external\eigen_archive\unsupported\eigen\cxx11\src/Tensor/TensorExecutor.h(143): note: 无构造函数可以接受源类型,或构造函数重载决策不明确 1> d:\tools\tensorflow-win\tensorflow\bazel-tensorflow\external\eigen_archive\unsupported\eigen\cxx11\src/Tensor/TensorExecutor.h(115): note: 编译类 模板 成员函数“void Eigen::internal::TensorExecutor<const Assign,Eigen::DefaultDevice,true,true>::run(Expression &,const Eigen::DefaultDevice &)”时 1> with 1> [ 1> Expression=const Assign 1> ]

1>d:\tools\tensorflow-win\tensorflow\bazel-tensorflow\external\eigen_archive\unsupported\eigen\cxx11\src/Tensor/TensorExecutor.h(144): error C2661:

CasonTsai commented 5 years ago

i think It's eigen's version mismatch.you can try the library https://github.com/fo40225/tensorflow-windows-wheel which comes with eigen lib.

fit-gao commented 5 years ago

@CasonTsai thank you so much for your reply!! I build the tensorflow.dll myself from branch 1.13, and I find it cause by this line: inputAnchorsTensor_temp.chip(i, 1) = eachrow; //通finalBox_norm矩阵构建Eigen::tensor类型的inputAnchorsTensor_temp Eigen::Tensor<float,3>inputAnchorsTensor_temp(1,finalBox_norm.rows(),finalBox_norm.cols()); for(int i=0;i<finalBox_norm.rows();i++){

        Eigen::Tensor<float,1>eachrow(finalBox_norm.cols());//用于临时存储finalBox_norm矩阵的的每一行
        //把finalBox_norm矩阵的一行放进eachrow
        eachrow.setValues({finalBox_norm.row(i)[0],finalBox_norm.row(i)[1],finalBox_norm.row(i)[2],finalBox_norm.row(i)[3]});
        //把eachrow放进inputAnchorsTensor_temp的每一行
        inputAnchorsTensor_temp.chip(i, 1) = eachrow;
    }

but it seems all right, and I do not know why, most probably like your reply, thanks again~~~