XiaoMi / mace-models

Mobile AI Compute Engine Model Zoo
Apache License 2.0
371 stars 73 forks source link

changing the input size of yolov3 #29

Open jonbakerfish opened 3 years ago

jonbakerfish commented 3 years ago

Hi, I want to change the input size of yolov3 to 320x224 (h,w). After modified the yolo-v3.yml to:

        input_shapes:
          # - 1,416,416,3
          - 1,320,224,3 
        output_shapes:
          # - 1,13,13,255
          # - 1,26,26,255
          # - 1,52,52,255
          - 1,10, 7,255
          - 1,20,14,255
          - 1,40,28,255

converting the model will raise these errors:

python tools/converter.py convert --config=../mace-models/yolo-v3/yolo-v3.yml

....

Traceback (most recent call last):
  File "/miniconda3/envs/mace/lib/python3.7/site-packages/tensorflow/python/framework/importer.py", line 426, in import_graph_def
    graph._c_graph, serialized, options)  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 1 in both shapes must be equal, but are 26 and 20. Shapes are [1,26,26] and [1,20,14]. for 'concatenate_1/concat' (op: 'ConcatV2') with input shapes: [1,26,26,256], [1,20,14,512], [] and with computed input tensors: input[2] = <3>.

How to solve these errors? Thank you.

lu229 commented 3 years ago

@jonbakerfish Does your model support the input shape ([1,320,224,3])? it seems that it doesn't support that input shape.

jonbakerfish commented 3 years ago

I'm using your provided pb file the yolo-v3.yml

lu229 commented 3 years ago

@jonbakerfish That model does not support input shape ([1,320,224,3])