infer.py预测报错
Created by: yran1011
I0610 10:48:35.660418 30902 analysis_predictor.cc:138] Profiler is deactivated, and no profiling report will be generated. I0610 10:48:35.693836 30902 analysis_predictor.cc:872] MODEL VERSION: 1.8.1 I0610 10:48:35.693872 30902 analysis_predictor.cc:874] PREDICTOR VERSION: 1.8.1 --- Running analysis [ir_graph_build_pass] --- Running analysis [ir_graph_clean_pass] --- Running analysis [ir_analysis_pass] --- Running IR pass [is_test_pass] --- Running IR pass [simplify_with_basic_ops_pass] --- Running IR pass [conv_affine_channel_fuse_pass] --- Running IR pass [conv_eltwiseadd_affine_channel_fuse_pass] --- Running IR pass [conv_bn_fuse_pass] I0610 10:48:36.681264 30902 graph_pattern_detector.cc:101] --- detected 78 subgraphs --- Running IR pass [conv_eltwiseadd_bn_fuse_pass] --- Running IR pass [embedding_eltwise_layernorm_fuse_pass] --- Running IR pass [multihead_matmul_fuse_pass_v2] --- Running IR pass [fc_fuse_pass] --- Running IR pass [fc_elementwise_layernorm_fuse_pass] --- Running IR pass [conv_elementwise_add_act_fuse_pass] I0610 10:48:39.250291 30902 graph_pattern_detector.cc:101] --- detected 53 subgraphs --- Running IR pass [conv_elementwise_add2_act_fuse_pass] --- Running IR pass [conv_elementwise_add_fuse_pass] I0610 10:48:39.285293 30902 graph_pattern_detector.cc:101] --- detected 26 subgraphs --- Running IR pass [transpose_flatten_concat_fuse_pass] --- Running IR pass [runtime_context_cache_pass] --- Running analysis [ir_params_sync_among_devices_pass] I0610 10:48:39.315143 30902 ir_params_sync_among_devices_pass.cc:41] Sync params from CPU to GPU --- Running analysis [adjust_cudnn_workspace_size_pass] --- Running analysis [inference_op_replace_pass] --- Running analysis [memory_optimize_pass] I0610 10:48:39.442423 30902 memory_optimize_pass.cc:223] Cluster name : relu_69.tmp_0 size: 1048576 I0610 10:48:39.442459 30902 memory_optimize_pass.cc:223] Cluster name : bilinear_interp_0.tmp_0 size: 1048576 I0610 10:48:39.442474 30902 memory_optimize_pass.cc:223] Cluster name : image size: 3145728 I0610 10:48:39.442482 30902 memory_optimize_pass.cc:223] Cluster name : relu_72.tmp_0 size: 8388608 I0610 10:48:39.442489 30902 memory_optimize_pass.cc:223] Cluster name : batch_norm_138.tmp_0 size: 8192 I0610 10:48:39.442497 30902 memory_optimize_pass.cc:223] Cluster name : relu_70.tmp_0 size: 8388608 I0610 10:48:39.442503 30902 memory_optimize_pass.cc:223] Cluster name : batch_norm_12.tmp_2 size: 16777216 I0610 10:48:39.442513 30902 memory_optimize_pass.cc:223] Cluster name : batch_norm_4.tmp_2 size: 33554432 I0610 10:48:39.442523 30902 memory_optimize_pass.cc:223] Cluster name : tmp_0 size: 8388608 I0610 10:48:39.442531 30902 memory_optimize_pass.cc:223] Cluster name : depthwise_conv2d_1.tmp_0 size: 33554432 --- Running analysis [ir_graph_to_program_pass] I0610 10:48:39.524194 30902 analysis_predictor.cc:493] ======= optimize end ======= W0610 10:48:39.632324 30902 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 75, Driver API Version: 10.2, Runtime API Version: 10.0 W0610 10:48:39.638306 30902 device_context.cc:260] device: 0, cuDNN Version: 7.6. Traceback (most recent call last): File "deploy/python/infer.py", line 323, in run(gflags.FLAGS.conf, gflags.FLAGS.input_dir, gflags.FLAGS.ext) File "deploy/python/infer.py", line 305, in run seg_predictor.predict(imgs) File "deploy/python/infer.py", line 276, in predict output_data = self.predictor.run(input_data)[0] paddle.fluid.core_avx.EnforceNotMet:
C++ Call Stacks (More useful to developers):
0 std::string paddle::platform::GetTraceBackString<std::string const&>(std::string const&, char const*, int) 1 paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int) 2 paddle::operators::ConvOp::ComputeOutputShape(paddle::framework::InferShapeContext*) const 3 paddle::operators::Conv2DFusionOp::InferShape(paddle::framework::InferShapeContext*) const 4 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&, paddle::framework::RuntimeContext*) const 5 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const 6 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&) 7 paddle::framework::NaiveExecutor::Run() 8 paddle::AnalysisPredictor::Run(std::vector<paddle::PaddleTensor, std::allocatorpaddle::PaddleTensor > const&, std::vector<paddle::PaddleTensor, std::allocatorpaddle::PaddleTensor >*, int)
Python Call Stacks (More useful to users):
File "/work/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2610, in append_op attrs=kwargs.get("attrs", None)) File "/work/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(*args, **kwargs) File "/work/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle/fluid/layers/nn.py", line 2933, in conv2d "data_format": data_format, File "/home/terrywang/RanYu/PaddleSeg/pdseg/models/libs/model_libs.py", line 125, in conv return fluid.layers.conv2d(*args, **kargs) File "/home/terrywang/RanYu/PaddleSeg/pdseg/models/backbone/xception.py", line 140, in entry_flow param_attr=param_attr)) File "/home/terrywang/RanYu/PaddleSeg/pdseg/models/backbone/xception.py", line 101, in net data = self.entry_flow(input) File "/home/terrywang/RanYu/PaddleSeg/pdseg/models/modeling/deeplab.py", line 225, in xception decode_points=decode_point) File "/home/terrywang/RanYu/PaddleSeg/pdseg/models/modeling/deeplab.py", line 233, in deeplabv3p data, decode_shortcut = xception(img) File "/home/terrywang/RanYu/PaddleSeg/pdseg/models/model_builder.py", line 79, in seg_model logits = deeplab.deeplabv3p(image, class_num) File "/home/terrywang/RanYu/PaddleSeg/pdseg/models/model_builder.py", line 166, in build_model logits = seg_model(image, class_num) File "pdseg/export_model.py", line 88, in export_inference_model infer_prog, startup_prog, phase=ModelPhase.PREDICT) File "pdseg/export_model.py", line 130, in main export_inference_model(args) File "pdseg/export_model.py", line 134, in main()
Error Message Summary:
InvalidArgumentError: The number of input's channels should be equal to filter's channels * groups for Op(Conv). But received: the input's channels is 512, the input's shape is [1, 512, 512, 3]; the filter's channels is 3, the filter's shape is [32, 3, 3, 3]; the groups is 1, the data_format is NCHW. The error may come from wrong data_format setting. [Hint: Expected input_channels == filter_dims[1] * groups, but received input_channels:512 != filter_dims[1] * groups:3.] at (/paddle/paddle/fluid/operators/conv_op.cc:94) [operator < conv2d_fusion > error]