Skip to content

Commit

Permalink
Update the error info for quantizaion (#32273)
Browse files Browse the repository at this point in the history
  • Loading branch information
juncaipeng authored Apr 21, 2021
1 parent 37bb334 commit 3da2c7f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions paddle/fluid/framework/ir/quant_conv2d_dequant_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,13 @@ void FuseDequant(ir::Graph* graph, Scope* scope,
quantized_op_type == "depthwise_conv2d") {
PADDLE_ENFORCE_EQ(
dequant_type, "fake_channel_wise_dequantize_max_abs",
platform::errors::InvalidArgument("conv2d op must be dequantized by "
"[fake_channel_wise_dequantize_max_"
"abs], but got %s",
dequant_type));
platform::errors::InvalidArgument(
"conv2d op must be dequantized by "
"[fake_channel_wise_dequantize_max_abs], but got %s. "
"If you uses PaddleSlim to generate the quantized "
"model, please set the 'weight_quantize_type' params as "
"'channel_wise_abs_max' and generate the quantized model again.",
dequant_type));
PADDLE_ENFORCE_EQ(
weight_scale.size(), static_cast<size_t>(w_dims[0]),
platform::errors::InvalidArgument(
Expand Down

0 comments on commit 3da2c7f

Please sign in to comment.