2/ the path getting there is still not easy. In my case, the onnx-coreml conversion script proved to make some weirdly bad assumptions about what would be in a model. My issues all revolved around tensor rank (it didn't like rank 2 in attention, and it somehow didn't pick up on
-
-
Show this thread
-
3/ the rank in some otherwise very normal operations (conv/batch norm). I didn't dig into the code too much because quite frankly it's suspiciously complicated and I didn't want to deal with that. Instead, I just patched it up by modifying the script to work with my case-
Show this thread
End of conversation
New conversation -
-
-
/4 which amounted to changed the calculated rank of tensors in a few places. After that was done, then indeed the model ported successfully to Core ML so yes, even DeOldify can port (strip all of the spectral norm first).
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
/5 PS what it looks like if you don't get this right: Core ML can still wind up compiling successfully, and then you get weird artifacts when running it in XCode. So as is usually the case in machine learning, the model is "not as good" as opposed to outright not working.
Show this thread -
New conversation -
-
-
/7 Also also.... Just put all your image normalization/denormalization code in additional layers sandwiching your model before converting it to Onnx. It's easier to reason about and do correctly where as Apple's code again is strange and not quite right.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Did you try the new direct porting to ios with the new pytorch 1.3 without Onnx? It is supposed to solve most of these issues.
-
I took a look. Support looked super early and there was going to be allot of work on my part to get my model in core ml comparatively speaking.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.