Main approaches tried for DeepLabv3 Core ML conversion #75
Replies: 6 comments 2 replies
-
Devices used for CoreML conversionI ran this code in multiple environments, the main ones being:
As it turns out, based on my experiments, running the conversion on Mac worked better. Not ideal, but it isn't surprising. |
Beta Was this translation helpful? Give feedback.
-
Approach 1: Reproduce the
|
Beta Was this translation helpful? Give feedback.
-
Approach 2: Reproduce the
|
Beta Was this translation helpful? Give feedback.
-
Approach 3: Use the models provided by AppleLink: https://developer.apple.com/machine-learning/models/ Utilized the DeepLabV3.mlmodel file. I converted the MLMultiArray output to a UIImage using code from the following link: Code used was similar to this: coreml_convet_spec copy.txt ResultThis is the only model that seems to have worked. However, this doesn't solve the CoreML conversion problem we are having, since this approach involves using an Out-Of-Box model. |
Beta Was this translation helpful? Give feedback.
-
Approach 4: Use the Basic version of official Apple documentation and build up from thereTutorial Link: The default DeepLabv3 model from the tutorial works, however, we want a model that can be used as a VNCoreMLModel. The tutorial model accepts MLMultiArray, and we want a model that accepts Image. It would also be necessary for it to output an image, for performance as well as code convenience. It is possible to change the input format by changing the conversion logic. We must remember to normalize the image: However, we would also like to change the output. When we change the output by taking into account the argmax requirement, we end up getting a failed compile, with the following error: |
Beta Was this translation helpful? Give feedback.
-
|
To note, there were dozens of other configurations tried, however, none of them seemed to have worked. The Apple documentation doesn't seem to have anything about this case, which is weird since they have clearly worked with conversion of DeepLabv3 model that accepts Image input. So it would have been prudent for them to document the process and make the documentation public. |
Beta Was this translation helpful? Give feedback.







Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello All,
So since the day before I have been trying several approaches for converting DeepLabv3 Pytorch model to CoreML.
I wanted to document all the important parts of this in a public page so that this can be discussed on in detail.
Beta Was this translation helpful? Give feedback.
All reactions