generate_proposals_op网络定义阶段与运行阶段的lod_level不一致
Created by: flishwang
generate_proposals_op.cc:
void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE_EQ(
ctx->HasInput("Scores"), true,
platform::errors::NotFound("Input(Scores) shouldn't be null."));
PADDLE_ENFORCE_EQ(
ctx->HasInput("BboxDeltas"), true,
platform::errors::NotFound("Input(BboxDeltas) shouldn't be null."));
PADDLE_ENFORCE_EQ(
ctx->HasInput("ImInfo"), true,
platform::errors::NotFound("Input(ImInfo) shouldn't be null."));
PADDLE_ENFORCE_EQ(
ctx->HasInput("Anchors"), true,
platform::errors::NotFound("Input(Anchors) shouldn't be null."));
PADDLE_ENFORCE_EQ(
ctx->HasInput("Variances"), true,
platform::errors::NotFound("Input(Variances) shouldn't be null."));
ctx->SetOutputDim("RpnRois", {-1, 4});
ctx->SetOutputDim("RpnRoiProbs", {-1, 1});
}
这部分代码,未设置lodlevel,导致输出的LodLevel为0。但计算图执行时,其输出附有lod_level=1的lod info. 因此,网络定义阶段,对RpnRrois及无法使用sequence_pool等lodTensor相关的算子进行处理。