【发布时间】:2020-06-08 09:07:48
【问题描述】:
我使用 Tensorflow GPU 和 Mobilenet v2 作为预训练模型训练了一个模型,之后我尝试将其转换为 CoreML,如 .mlmodel。我读到您需要添加一些前/后预处理,为此您可以创建一个管道并在 Xcode 中使用该管道。我试过使用他们的例子,可以在这里找到:
https://github.com/hollance/coreml-survival-guide/blob/master/MobileNetV2%2BSSDLite/ssdlite.py
转换成功,但我无法在 Xcode 中使用它,我收到此错误并且我不知道如何解决它,因为此过程没有完整记录。错误:
Error Domain=com.apple.vis Code=3 "The VNCoreMLTransform request failed" UserInfo={NSLocalizedDescription=The VNCoreMLTransform request failed, NSUnderlyingError=0x2828e8b40 {Error Domain=com.apple.CoreML Code=0 "Failed to evaluate model 1 in pipeline" UserInfo={NSLocalizedDescription=Failed to evaluate model 1 in pipeline, NSUnderlyingError=0x2828e9560 {Error Domain=com.apple.CoreML Code=0 "Shape (2 x 1 x 1917) was not in enumerated set of allowed shapes" UserInfo={NSLocalizedDescription=Shape (2 x 1 x 1917) was not in enumerated set of allowed shapes}}}}}
这也是模型的外观:
【问题讨论】:
标签: swift tensorflow coreml coremltools