title: Metal device not found/Error in declaring network when initializing CoreML model
body: <p>When trying to use any of Apple's CoreML tutorials (for example, <a href="https://developer.apple.com/documentation/vision/classifying_images_with_vision_and_core_ml" rel="nofollow noreferrer">this one</a>), when the code initializes the model like so:</p>
  
  <pre><code>let model = try VNCoreMLModel(for: MobileNet().model)
  </code></pre>
  
  <p>I get the following error in the autogenerated code for the model (MobileNet.swift), on the last line of this segment: </p>
  
  <pre><code>let bundle = Bundle.main
  let assetPath = bundle.url(forResource: "MobileNet", withExtension:"mlmodelc")
  try! self.init(contentsOf: assetPath!)
  </code></pre>
  
  <p>Error: <code>Thread 5: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.}</code></p>
  
  <p>Additionally, I get the following output in the console:</p>
  
  <pre><code>2018-06-23 15:46:27.216514-0700 Vision+ML Example[375:20287] [espresso] [Espresso::handle_ex_] exception=Metal device not found.
  2018-06-23 15:46:27.328956-0700 Vision+ML Example[375:20287] [espresso] [Espresso::handle_ex_plan] exception=Error creating mps kernel
  2018-06-23 15:46:27.329321-0700 Vision+ML Example[375:20287] [coreml] Error in adding network -1.
  2018-06-23 15:46:27.347582-0700 Vision+ML Example[375:20287] [coreml] MLModelAsset: load failed with error Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.}
  2018-06-23 15:46:27.347759-0700 Vision+ML Example[375:20287] [coreml] MLModelAsset: modelWithError: load failed with error Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.}
  </code></pre>
  
  <p>...and the app crashes.</p>
  
  <p>What's going on here? I'm just running a tutorial from Apple's dev site, nothing else! (I'm testing on an iPhone 5s, iOS 12 beta 2, and am building on a MacBook Air running macOS 10.14 beta 2 with Xcode 10.0 beta 2)</p>