Error converting hustvl/yolos-tiny

#14
by kevin58332 - opened

Conversion Settings:

        Model: hustvl/yolos-tiny
        Task: object-detection
        Framework: pt
        Compute Units: ComputeUnit.ALL
        Precision: float32
        Tolerance: None
        Push to: None

        Error: Output values do not match between reference model and Core ML exported model: Got max absolute difference of: 11.82904052734375
        

Hopefully this can get fixed soon!

Core ML Projects org

Thanks for the report, I'll take a look!

Thanks for the help! I was able to convert it to .mlpackage and even .pl but I haven't been to get it to .mlmodel which is what I need for my application.

Core ML Projects org

Hi @kevin58332 ! .mlpackage bundles can be added to Xcode projects as a resource. Could you please explain why you need a different format? Thank you!

Hey @pcuenq , so I figured out how to make the preview window pop up for yolo models. Looks like a line of code was missing from your exporters repo. The issue now though is when I input an image into the preview, I do not get an output. I'm starting to wonder if it has to do with the model output being logits and pred_boxes instead of confidence and coordinates. I'm not 100% sure if xcode knows how to handle the logits aspect of this but I would assume no. I'm currently working on trying to see if I can change the output to confidence and coordinates and will let you know if that fixes things.

Core ML Projects org

Sounds like great progress! Would you mind letting me know what was the missing line you had to add?

Also, please note that Xcode is able to preview certain tasks and outputs, I'm not sure if YOLO outputs will be compatible with it. This is a summary from the coremltools documentation that could be helpful: https://coremltools.readme.io/docs/xcode-model-preview-types.

Good luck, please keep us posted if you will :)

Sure thing! I'll try to see if I can get this in a working state first and let you know what all I had to do. My thoughts are that I should be able to get it working since I recently downloaded a coreml version of yolov5s that was posted in github and everything works in xcode for that model. My thoughts are that I may have to add a pipeline to convert the logits output of the current yolos-tiny model so we'll see if that works.

Hey @pcuenq ! Good news! I was able to get it in a working state using the pipeline method! I still have some kinks to work out but so far its looking good! I can upload the code once I get the small bugs fixed.

Screenshot 2023-06-14 at 4.06.29 PM.png

Core ML Projects org

Awesome!! Congrats, and thanks a lot!

Sign up or log in to comment