lsrock1 / maskrcnn_benchmark.cpp

Implementation maskrcnn-benchmark, pytorch c++ frontend
MIT License
81 stars 23 forks source link

i use libtorch 1.1.0 cuda_10,make error #2

Closed mathpopo closed 5 years ago

mathpopo commented 5 years ago

[ 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) { ^~~~~

lsrock1 commented 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