Get from pytorch code to mlmodel

Does anybody know if it's a reasonable thought to develop models in pytorch? That is, will I have any hope of getting the trained model converted to an mlmodel? It somehow seems hard to imagine that a converter won't turn up at some point, since torch looks very awesome for building/training models.

Accepted Reply

try this https://github.com/prisma-ai/torch2coreml

It seems to will works with pytorch

Replies

try this https://github.com/prisma-ai/torch2coreml

It seems to will works with pytorch

Wow! Very exciting. The 10.13 requirement is a bit of a drag, since I've been developing on 10.12.6 (stable), and testing on my iPhone running the iOS 11 beta... But I can probably/hopefully upgrade my laptop pretty soon. I was surprised I hadn't found this, until I noticed that it's only a couple of days old! ;-)


Thanks for point it out.

I don’t think torch2coreml works for PyTorch. But you can use ONNX-CoreML: https://github.com/onnx/onnx-coreml


I wrote a detailed post about this: https://attardi.org/pytorch-and-coreml/