模型导出时报错RuntimeError: Shape not matching
Created by: sdjkxhb2016
导出YOLOv3模型,输入是3x320x320
!python tools/export_model.py
-c configs/yolov3_mobilenet_v1_insect.yml
--output_dir=work/inference_model
-o weights=https://paddlemodels.bj.bcebos.com/object_detection/yolov3_darknet.tar
YoloTestFeed.image_shape=[3,640,640]
使用上面的方式,导出模型时,报错 把[3,640,640]修改为[3,320,320] 或[3,608,608],报同样的错,我在 yolov3_mobilenet_v1_insect 里配置的是 image_shape: [3, 608, 608]
2020-01-20 14:31:42,149-INFO: Found /home/aistudio/.cache/paddle/weights/yolov3_darknet 2020-01-20 14:31:42,149-INFO: Loading parameters from /home/aistudio/.cache/paddle/weights/yolov3_darknet... Traceback (most recent call last): File "tools/export_model.py", line 118, in main() File "tools/export_model.py", line 105, in main checkpoint.load_params(exe, infer_prog, cfg.weights) File "/home/aistudio/work/PaddleDetection/ppdet/utils/checkpoint.py", line 118, in load_params fluid.io.load_vars(exe, path, prog, predicate=_if_exist) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/io.py", line 682, in load_vars filename=filename) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/io.py", line 741, in load_vars format(orig_shape, each_var.name, new_shape)) RuntimeError: Shape not matching: the Program requires a parameter with a shape of ((366,)), while the loaded parameter (namely [ yolo_output.0.conv.bias ]) has a shape of ((255,)).