PointNet++编译失败
Created by: alfredtorres
您好,我想在ai studio平台复现PointNet++,在编译自定义OP时失败。输出如下:
aistudio@jupyter-259415-338227:~/work/PointNet2/ext_op/src$ sh make.sh
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/libs
gather_point_op.cc:97:14: error: ‘GradOpPtr’ has not been declared
void Apply(GradOpPtr<T> op) const override {
^
gather_point_op.cc:97:23: error: expected ‘,’ or ‘...’ before ‘<’ token
void Apply(GradOpPtr<T> op) const override {
^
gather_point_op.cc: In member function ‘void paddle::operators::GatherPointGradDescMaker<T>::Apply(int) const’:
gather_point_op.cc:98:5: error: ‘op’ was not declared in this scope
op->SetType("gather_point_grad");
^
gather_point_op.cc: In instantiation of ‘class paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>’:
/usr/include/c++/5/type_traits:1459:12: required from ‘struct std::is_base_of<paddle::framework::OperatorBase, paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc> >’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:74:25: required from ‘constexpr const bool paddle::framework::details::internal::IsMatchedBaseTypeImpl<paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>, 0, true>::kValue’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:86:63: required from ‘constexpr bool paddle::framework::details::internal::IsMatchedBaseType() [with T = paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>; int kPos = 0]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:118:53: required by substitution of ‘template<class T> using OpInfoFillTypeGetter = paddle::framework::details::internal::OpInfoFillTypeGetterImpl<T, 0, 8, false, IsMatchedBaseType<T, 0>()> [with T = paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:125:47: required from ‘static constexpr paddle::framework::details::OpInfoFillType paddle::framework::details::OpInfoFillTypeID<T>::ID() [with T = paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:144:71: recursively required from ‘paddle::framework::details::OperatorRegistrarRecursive<I, false, ARGS ...>::OperatorRegistrarRecursive(const char*, paddle::framework::OpInfo*) [with long unsigned int I = 1ul; ARGS = {paddle::operators::GatherPointOp, paddle::operators::GatherPointOpMaker, paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>, paddle::operators::GatherPointGradDescMaker<paddle::imperative::OpBase>}]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:144:71: required from ‘paddle::framework::details::OperatorRegistrarRecursive<I, false, ARGS ...>::OperatorRegistrarRecursive(const char*, paddle::framework::OpInfo*) [with long unsigned int I = 0ul; ARGS = {paddle::operators::GatherPointOp, paddle::operators::GatherPointOpMaker, paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>, paddle::operators::GatherPointGradDescMaker<paddle::imperative::OpBase>}]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/op_registry.h:63:5: required from ‘paddle::framework::OperatorRegistrar<ARGS>::OperatorRegistrar(const char*) [with ARGS = {paddle::operators::GatherPointOp, paddle::operators::GatherPointOpMaker, paddle::operators::GatherPointGradDescMaker<paddle::framework::OpDesc>, paddle::operators::GatherPointGradDescMaker<paddle::imperative::OpBase>}]’
gather_point_op.cc:111:1: required from here
gather_point_op.cc:97:8: error: ‘void paddle::operators::GatherPointGradDescMaker<T>::Apply(int) const [with T = paddle::framework::OpDesc]’ marked ‘override’, but does not override
void Apply(GradOpPtr<T> op) const override {
^
group_points_op.cc:105:14: error: ‘GradOpPtr’ has not been declared
void Apply(GradOpPtr<T> op) const override {
^
group_points_op.cc:105:23: error: expected ‘,’ or ‘...’ before ‘<’ token
void Apply(GradOpPtr<T> op) const override {
^
group_points_op.cc: In member function ‘void paddle::operators::GroupPointsGradDescMaker<T>::Apply(int) const’:
group_points_op.cc:106:5: error: ‘op’ was not declared in this scope
op->SetType("group_points_grad");
^
group_points_op.cc: In instantiation of ‘class paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>’:
/usr/include/c++/5/type_traits:1459:12: required from ‘struct std::is_base_of<paddle::framework::OperatorBase, paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc> >’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:74:25: required from ‘constexpr const bool paddle::framework::details::internal::IsMatchedBaseTypeImpl<paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>, 0, true>::kValue’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:86:63: required from ‘constexpr bool paddle::framework::details::internal::IsMatchedBaseType() [with T = paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>; int kPos = 0]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:118:53: required by substitution of ‘template<class T> using OpInfoFillTypeGetter = paddle::framework::details::internal::OpInfoFillTypeGetterImpl<T, 0, 8, false, IsMatchedBaseType<T, 0>()> [with T = paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:125:47: required from ‘static constexpr paddle::framework::details::OpInfoFillType paddle::framework::details::OpInfoFillTypeID<T>::ID() [with T = paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:144:71: recursively required from ‘paddle::framework::details::OperatorRegistrarRecursive<I, false, ARGS ...>::OperatorRegistrarRecursive(const char*, paddle::framework::OpInfo*) [with long unsigned int I = 1ul; ARGS = {paddle::operators::GroupPointsOp, paddle::operators::GroupPointsOpMaker, paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>, paddle::operators::GroupPointsGradDescMaker<paddle::imperative::OpBase>}]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:144:71: required from ‘paddle::framework::details::OperatorRegistrarRecursive<I, false, ARGS ...>::OperatorRegistrarRecursive(const char*, paddle::framework::OpInfo*) [with long unsigned int I = 0ul; ARGS = {paddle::operators::GroupPointsOp, paddle::operators::GroupPointsOpMaker, paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>, paddle::operators::GroupPointsGradDescMaker<paddle::imperative::OpBase>}]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/op_registry.h:63:5: required from ‘paddle::framework::OperatorRegistrar<ARGS>::OperatorRegistrar(const char*) [with ARGS = {paddle::operators::GroupPointsOp, paddle::operators::GroupPointsOpMaker, paddle::operators::GroupPointsGradDescMaker<paddle::framework::OpDesc>, paddle::operators::GroupPointsGradDescMaker<paddle::imperative::OpBase>}]’
group_points_op.cc:119:1: required from here
group_points_op.cc:105:8: error: ‘void paddle::operators::GroupPointsGradDescMaker<T>::Apply(int) const [with T = paddle::framework::OpDesc]’ marked ‘override’, but does not override
void Apply(GradOpPtr<T> op) const override {
^
three_interp_op.cc:120:14: error: ‘GradOpPtr’ has not been declared
void Apply(GradOpPtr<T> op) const override {
^
three_interp_op.cc:120:23: error: expected ‘,’ or ‘...’ before ‘<’ token
void Apply(GradOpPtr<T> op) const override {
^
three_interp_op.cc: In member function ‘void paddle::operators::ThreeInterpGradDescMaker<T>::Apply(int) const’:
three_interp_op.cc:121:5: error: ‘op’ was not declared in this scope
op->SetType("three_interp_grad");
^
three_interp_op.cc: In instantiation of ‘class paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>’:
/usr/include/c++/5/type_traits:1459:12: required from ‘struct std::is_base_of<paddle::framework::OperatorBase, paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc> >’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:74:25: required from ‘constexpr const bool paddle::framework::details::internal::IsMatchedBaseTypeImpl<paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>, 0, true>::kValue’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:86:63: required from ‘constexpr bool paddle::framework::details::internal::IsMatchedBaseType() [with T = paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>; int kPos = 0]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:118:53: required by substitution of ‘template<class T> using OpInfoFillTypeGetter = paddle::framework::details::internal::OpInfoFillTypeGetterImpl<T, 0, 8, false, IsMatchedBaseType<T, 0>()> [with T = paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:125:47: required from ‘static constexpr paddle::framework::details::OpInfoFillType paddle::framework::details::OpInfoFillTypeID<T>::ID() [with T = paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:144:71: recursively required from ‘paddle::framework::details::OperatorRegistrarRecursive<I, false, ARGS ...>::OperatorRegistrarRecursive(const char*, paddle::framework::OpInfo*) [with long unsigned int I = 1ul; ARGS = {paddle::operators::ThreeInterpOp, paddle::operators::ThreeInterpOpMaker, paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>, paddle::operators::ThreeInterpGradDescMaker<paddle::imperative::OpBase>}]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/details/op_registry.h:144:71: required from ‘paddle::framework::details::OperatorRegistrarRecursive<I, false, ARGS ...>::OperatorRegistrarRecursive(const char*, paddle::framework::OpInfo*) [with long unsigned int I = 0ul; ARGS = {paddle::operators::ThreeInterpOp, paddle::operators::ThreeInterpOpMaker, paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>, paddle::operators::ThreeInterpGradDescMaker<paddle::imperative::OpBase>}]’
/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/include/paddle/fluid/framework/op_registry.h:63:5: required from ‘paddle::framework::OperatorRegistrar<ARGS>::OperatorRegistrar(const char*) [with ARGS = {paddle::operators::ThreeInterpOp, paddle::operators::ThreeInterpOpMaker, paddle::operators::ThreeInterpGradDescMaker<paddle::framework::OpDesc>, paddle::operators::ThreeInterpGradDescMaker<paddle::imperative::OpBase>}]’
three_interp_op.cc:135:1: required from here
three_interp_op.cc:120:8: error: ‘void paddle::operators::ThreeInterpGradDescMaker<T>::Apply(int) const [with T = paddle::framework::OpDesc]’ marked ‘override’, but does not override
void Apply(GradOpPtr<T> op) const override {
我发现错误是因为下面这句
g++ farthest_point_sampling_op.cc farthest_point_sampling_op.cu.o gather_point_op.cc gather_point_op.cu.o group_points_op.cc group_points_op.cu.o query_ball_op.cu.o query_ball_op.cc three_interp_op.cu.o three_interp_op.cc three_nn_op.cu.o three_nn_op.cc -o pointnet_lib.so -DPADDLE_WITH_MKLDNN -shared -fPIC -std=c++11 -O0 -g \
-I ${include_dir}/third_party/ \
-I ${include_dir} \
-L ${lib_dir} \
-L /usr/local/cuda/lib64 -lpaddle_framework -lcudart
是不能在ai studio上编译吗?