模型裁剪后,infer出现维度问题,eval以及vis都未出现
Created by: Diuyon
再进行trian、eval、vis操作均正常后,将模型裁剪导出却出现维度不匹配的问题
错误日志:
I0325 17:23:17.724233 1492 analysis_predictor.cc:462] ======= optimize end =======
Traceback (most recent call last):
File "d:/work/cut_face/paddlePredict/infer.py", line 319, in <module>
run(gflags.FLAGS.conf, gflags.FLAGS.input_dir, gflags.FLAGS.ext)
File "d:/work/cut_face/paddlePredict/infer.py", line 301, in run
seg_predictor.predict(imgs)
File "d:/work/cut_face/paddlePredict/infer.py", line 272, in predict
output_data = self.predictor.run(input_data)[0]
paddle.fluid.core_avx.EnforceNotMet:
--------------------------------------------
C++ Call Stacks (More useful to developers):
--------------------------------------------
Windows not support stack backtrace yet.
------------------------------------------
Python Call Stacks (More useful to users):
------------------------------------------
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2525, in append_op
attrs=kwargs.get("attrs", None))
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py", line 243, in __impl__
attrs={'axis': axis})
File "/home/aistudio/work/PaddleSeg/pdseg/models/model_builder.py", line 152, in export_preprocess
image = (image / 255 - mean) / std
File "/home/aistudio/work/PaddleSeg/pdseg/models/model_builder.py", line 184, in build_model
origin_image)
File "pdseg/export_model.py", line 88, in export_inference_model
infer_prog, startup_prog, phase=ModelPhase.PREDICT)
File "pdseg/export_model.py", line 124, in main
export_inference_model(args)
File "pdseg/export_model.py", line 128, in <module>
main()
----------------------
Error Message Summary:
----------------------
Error: ShapeError: broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [1, 1000, 1000, 1000] and the shape of Y = [1, 3, 1, 1]. Received [1000] in X is not equal to [3] in Y at (D:\1.7.1\paddle\paddle/fluid/operators/elementwise/elementwise_op_function.h:145)
[operator < elementwise_sub > error]
调试结果:
deploy.yaml文件
DEPLOY:
USE_GPU : 0
USE_PR : 1
MODEL_PATH : "freeze_model"
MODEL_FILENAME : "model"
PARAMS_FILENAME : "params"
EVAL_CROP_SIZE : (1000, 1000)
MEAN : [0.5, 0.5, 0.5]
STD : [0.5, 0.5, 0.5]
IMAGE_TYPE : "rgb"
NUM_CLASSES : 2
CHANNELS : 3
PRE_PROCESSOR : "SegPreProcessor"
PREDICTOR_MODE : "ANALYSIS"
BATCH_SIZE : 1