facebookresearch / Detectron

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
Apache License 2.0
26.24k stars 5.45k forks source link

How to REGISTER_CUDA_OPERATOR GenerateProposals using GPUFallbackOp #446

Open HappyKerry opened 6 years ago

HappyKerry commented 6 years ago

The CPU code is here, https://github.com/pytorch/pytorch/blob/master/caffe2/operators/generate_proposals_op.cc

I try the following code

include "caffe2/core/context_gpu.h"

include "caffe2/operators/operator_fallback_gpu.h"

include "caffe2/operators/generate_proposals_op.h"

namespace caffe2 { REGISTER_CUDA_OPERATOR(GenerateProposals, PUFallbackOp<GenerateProposalsOp>); }

but error happened when remake caffe2

[ 84%] Linking CXX executable ../bin/elementwise_op_gpu_test ../lib/libcaffe2_gpu.so

:对‘caffe2::CAFFE2_PLEASE_ADD_OPERATOR_SCHEMA_FOR_GenerateProposals()’未定义的引用 collect2: error: ld returned 1 exit status caffe2/CMakeFiles/elementwise_op_gpu_test.dir/build.make:117: recipe for target 'bin/elementwise_op_gpu_test' failed make[2]: [bin/elementwise_op_gpu_test] Error 1 CMakeFiles/Makefile2:1666: recipe for target 'caffe2/CMakeFiles/elementwise_op_gpu_test.dir/all' failed make[1]: [caffe2/CMakeFiles/elementwise_op_gpu_test.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2

HappyKerry commented 6 years ago

@daquexian @ir413