New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support face-parsing model #12
Comments
Thanks you very much. It saves me a lot of time. |
@tucan9389 I am interested in using coremltools to convert pytorch models to coreml models. Is the coremltools sample the best guide to follow for learning purposes? https://coremltools.readme.io/docs/pytorch-conversion-examples I am able to run the face-parsing pytorch model, and successfully run the test script (after modifications to script to remove hard-coded values). However when I run your conversion script I am getting the failures below:
Any ideas or recommendations to resolve above issues would be greatly appreciated! |
@tucan9389 Numpy 1.20.0 is not compatible with coremltools, according to apple/coremltools#1077 I was able to resolve the exception by updating the environment to install version 1.19.5 of numpy. After changing this I encountered new error:
According to apple/coremltools#1012 coremltools version 4.1 must be used with torch 1.8. My environment was using 4.0. I resolved this exception by installing coremltools 4.1 (instead of 4.0). The CoreML model has now been created :) I will try using your conversion script as reference to create new conversion scripts for some other pytorch models I've been working with... Any advice or tips would be appreciated. |
Source Model Link
https://github.com/zllrunning/face-parsing.PyTorch
Core ML Model Download Link
https://github.com/tucan9389/SemanticSegmentation-CoreML/releases/download/support-face-parsing/FaceParsing.mlmodel
Model Spec
['background', 'skin', 'l_brow', 'r_brow', 'l_eye', 'r_eye', 'eye_g', 'l_ear', 'r_ear', 'ear_r', 'nose', 'mouth', 'u_lip', 'l_lip', 'neck', 'neck_l', 'cloth', 'hair', 'hat']
Conversion Script
The text was updated successfully, but these errors were encountered: