MLModelCollection status is always 1 - syncing

Hi all,

I have a problem with retrieving a model collection from a deployment. I tried to implement it like it was shown in WWDC 'Use model deployment and security with Core ML' session and here but I found that beginAccesing method doesn't exist for MLModelCollection class.

Then I used Apple's documentation for 'Retrieving a Model Collection from a Deployment' and implement it like it is described, but status property of the collection model is always MLModelCollection.Status.syncing.

Code:

let coinModelCollection = MLModelCollection(identifier: "TestCoinDetector")
coinModelCollection.isSynchronizationEnabled = true

print("Model collection status \(coinModelCollection.status.rawValue)")

if let coinModel = coinModelCollection.entries?["CoinDetector"] {
// entries are always empty
}

I created the model collection in the Core ML Model Deployment dashboard with the same "TestCoinDetector" identifier and also created model deployment and uploaded mlarchive. I used the same team as for the project.

I know that system itself is deciding when to download the model in the background, but more than 24 hours passed and the status is still syncing.

Can someone tell me did I do something wrong or maybe I need to set some configuration to the project, add some Capability, add some permissions or something else?

Thanks

Replies

Hi @marko.milinovic. The beginAccesing method became available in iOS 14 beta 2. That API is a lot more straightforward to understand whether the download is succeeding or not with the completion handler. Can you try updating to beta 3 and report back if that works for you?
I tried beta 3 with
Code Block
beginAccessing
but getting code signing errors regarding the team ID. Would love to hear if anybody else gets this error(https://developer.apple.com/forums/thread/655252)


Hi @Frameworks Engineer, thanks for your reply.

I updated the Xcode to the 12.0 beta 4, device to the iOS 14 Beta 4 and tried 'beginAccesing' method. I agree that it is better for understanding whether the download is succeeding or not. In my case I still can not download the model, I get the following error:

[coreml] MLModelCollection: namespace ('TEAM_ID'.TestCoinDetector) download failed. Error Domain=com.apple.trial Code=0 "Unknown error." UserInfo={NSLocalizedDescription=Unknown error.}
Error Domain=com.apple.CoreML Code=11 "Failed to begin access for model collection with identifier 'TestCoinDetector': download failed" UserInfo={NSLocalizedDescription=Failed to begin access for model collection with identifier 'TestCoinDetector': download failed}

What can be the reason for this?

Thanks
Hi,

Im facing the issue same as @marko.milinovic. Any solution found @FrameworkEngineer.

MLModelCollection: namespace (TeamID.BCGCoreMLModelCollection) download failed. Error Domain=com.apple.trial Code=0 "Unknown error." UserInfo={NSLocalizedDescription=Unknown error.}

Error Domain=com.apple.CoreML Code=10 \"Failed to begin access for model collection with identifier \'BCGCoreMLModelCollection\': invalid identifier\" UserInfo={NSLocalizedDescription=Failed to begin access for model collection with identifier \'BCGCoreMLModelCollection\': invalid identifier}"

Hi, I encountered exactly the same issue even though I went through and followed all the steps in:
iOS: 14.3 (18C66), iPhone 12 Pro Max

I even tried to create the test collection at different Teams. All without any luck to solve this issue... As I was going through the Developer Forum, I also noticed that many ML Developers have this kind of issue.

Code Block
CloudDeploymentTest[18290:11523393] [coreml] MLModelCollection: namespace (TEAM_ID.test_collection) download failed. Error Domain=com.apple.trial Code=0 "Unknown error." UserInfo={NSLocalizedDescription=Unknown error.}
Error accessing a model collection: Error Domain=com.apple.CoreML Code=10 "Failed to begin access for model collection with identifier 'test_collection': invalid identifier" UserInfo={NSLocalizedDescription=Failed to begin access for model collection with identifier 'test_collection': invalid identifier}


Any help would be highly appreciated!