Skip to content

Export.py need train mode export for cormel model to add NMS and decode layer #9667

@junmcenroe

Description

@junmcenroe

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Export

Bug

I had had been converted with export.py with -train mode to convert cormel model. after exported .mlmodel, I added decode layer and NMS. But after eliminate -train mode of export.py, I found the following error.


/usr/local/lib/python3.7/dist-packages/coremltools/models/neural_network/builder.py in set_output(self, output_names, output_dims)
529 spec = self.spec
530 for idx, dim in enumerate(output_dims):
--> 531 spec.description.output[idx].type.multiArrayType.ClearField("shape")
532 spec.description.output[idx].type.multiArrayType.shape.extend(dim)
533 spec.description.output[

IndexError: list index (1) out of range


Exported model shape with -train model and eval mode are different. So I modify the export.py with train mode, no failure found.
On "Remove .train() mode exports #9429", this train() mode removed. but Could you add train() mode to export.py ?

Environment

Google Colab

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleStale and schedule for closing soonbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions