janaz
janaz

Reputation: 703

How to import and use CreateML or CreateMLUI in Xcode

I would like to use the new CreateML and CreateMLUI Swift frameworks.

But when I write:

import CreateML

Xcode gives me an error:

No such module 'CreateML'

How can I use those in Xcode?

Upvotes: 7

Views: 6176

Answers (4)

Atimis
Atimis

Reputation: 64

For Xcode 10 - beta 6 You don't have to upgrade to Mojave. The newest Xcode - beta already supports 10.13.x. (From Apple Developer Forums).

I followed this step to try CreateML framework.

  1. Upgraded to latest MacOS (Not Mojave)
  2. Upgraded latest Xcode - beta.
  3. Create playground in macOS template (Default is iOS template)

Then, I can use createMLUI.

Upvotes: 0

Karoly Nyisztor
Karoly Nyisztor

Reputation: 3595

Install Mojave* and Xcode 10. Create a new playground and make sure you select macOS as the target (e.g. macOS Single View). Type in import CreateMLUI- it should compile without problems.

(*)macOS Mojave is officially available since yesterday.

Upvotes: 1

janaz
janaz

Reputation: 703

To import CoreML or CoreMLUI you need to get latest software:

  1. Go to https://developer.apple.com/download/
  2. Install macOS Mojave 10.14 beta version.
  3. Install Xcode 10 beta.
  4. Create a macOS platform template.

HOW TO CREATE YOUR OWN MLMODEL: https://developer.apple.com/documentation/create_ml/creating_an_image_classifier_model

Use free MLModels provided by apple: https://developer.apple.com/machine-learning/run-a-model/

Upvotes: 11

jfgrang
jfgrang

Reputation: 1178

You need to

  1. Have Mojave installed
  2. Install Xcode 10 beta
  3. Create a macOS template playground (not iOS)

Upvotes: 9

Related Questions