Closed mathpopo closed 5 years ago
The error is libtorch bug.(Also in readme, installation section)
try in maskrcnn_benchmark.cpp/lib/libtorch/include/torch/csrc/autograd/VariableTypeUtils.h insert #pramga once into the first line
related pull request in pytorch! https://github.com/pytorch/pytorch/pull/21134
[ 26%] Building CXX object source/rcnn/solver/CMakeFiles/solver.dir/solver_build.cpp.o In file included from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/layers/../../../include/rcnn/layers/roi_align.h:4:0, from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/modeling/../../../include/rcnn/modeling/poolers.h:4, from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/modeling/../../../include/rcnn/modeling/roi_heads/box_head/roi_box_feature_extractors.h:6, from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/modeling/../../../include/rcnn/modeling/roi_heads/box_head/box_head.h:6, from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/modeling/../../../include/rcnn/modeling/roi_heads/roi_heads.h:5, from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/modeling/../../../include/rcnn/modeling/detector/generalized_rcnn.h:12, from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/solver/../../../include/rcnn/solver/solver_build.h:4, from /home/chenxin/Desktop/maskrcnn_benchmark.cpp/source/rcnn/solver/solver_build.cpp:1: /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/include/torch/csrc/autograd/VariableTypeUtils.h: In function ‘void torch::autograd::check_inplace(const at::Tensor&)’: /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/include/torch/csrc/autograd/VariableTypeUtils.h:45:13: error: redefinition of ‘void torch::autograd::check_inplace(const at::Tensor&)’ inline void check_inplace(const Tensor& tensor) { ^
~~~~