Machine Learning by By Audrey Tam & Matthijs Hollemans & By Matthijs Hollemans & By Chris LaPollo

Machine Learning by By Audrey Tam & Matthijs Hollemans & By Matthijs Hollemans & By Chris LaPollo

Author:By Audrey Tam & Matthijs Hollemans & By Matthijs Hollemans & By Chris LaPollo
Language: eng
Format: epub
Publisher: Ray Wenderlich


When you run this code, coremltools goes through the Keras model layer-by-layer and prints its progress.

You can also supply metadata, which can be helpful for the users of your model, especially the descriptions of the inputs and outputs:

coreml_model.author = "Your Name Here" coreml_model.license = "Public Domain" coreml_model.short_description = "Image classifier for 20 different types of snacks" coreml_model.input_description["image"] = "Input image" coreml_model.output_description["labelProbability"]= "Prediction probabilities" coreml_model.output_description["label"]= "Class label of top prediction"

At this point, it’s useful to write print(coreml_model) to make sure that everything is correct. The input should be of type imageType, not multiArrayType, and there should be two outputs: one a dictionaryType and the other a stringType.

Finally, save the model to an .mlmodel file:

coreml_model.save("MultiSnacks.mlmodel")

If you weren’t on your Mac already, then download this .mlmodel file to your Mac.

Double-click the file to open it in Xcode:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.