huggingface / swift-coreml-transformers

Swift Core ML 3 implementations of GPT-2, DistilGPT-2, BERT, and DistilBERT for Question answering. Other Transformers coming soon!
Apache License 2.0
1.61k stars 176 forks source link

Command CoreMLModelCompile failed with a nonzero exit code #18

Open Elwin-zhao opened 4 years ago

Elwin-zhao commented 4 years ago

Command CoreMLModelCompile failed with a nonzero exit code

hollance commented 4 years ago

You'll need to provide more info, @ITBackkom.

Usually there is an additional error message that explains why CoreMLModelCompile failed (you can see this in the build log pane in Xcode). What does this error message say?

Which model does it fail on?

What is the file size of that model file when you look at it with Finder?

mredig commented 4 years ago

I'm also running into this. I think this is the error you're looking for:

coremlc: Error: Error reading protobuf spec. validator error: unable to deserialize object

image

Using Xcode 11.5 on macOS 10.15.3. Simply downloaded the zip and tried to build project/run tests/run project.

hollance commented 4 years ago

What is the file size of that model file when you look at it with Finder?

This repo uses git-lfs to store the large model files. Most likely, your model file is only a few bytes in size and is a placeholder for the actual thing.

mredig commented 4 years ago

What is the file size of that model file when you look at it with Finder?

This repo uses git-lfs to store the large model files. Most likely, your model file is only a few bytes in size and is a placeholder for the actual thing.

I’m pretty sure this is correct. Did I miss any getting started instructions anywhere? I downloaded the zip instead of cloning, if that makes a difference at all.

julien-c commented 4 years ago

Yes that's definitely the reason then. Thanks @hollance for helping.

You need to install git-lfs following https://github.com/huggingface/swift-coreml-transformers#notes

mredig commented 4 years ago

Does that mean that downloading the zip is useless? (might warrant a readme update)

jeffxtang commented 4 years ago

Apple has sample code and model that runs without requiring lfs.