admin管理员组文章数量:1417554
I have a recurring problem using my ML model in Xcode. The model is created using tensorflow in .mlpackage format. I have dragged the .mlpackage directory from Finder into Xcode, removed it from "Compile Sources, but kept it in "Copy bundle resources".
When opening the "model.mlpackage" in Xcode, I see "Model class has not been generated yet". I take for granted the class file must exist.
I have tried repeated "Clean" and "build" but keep getting "Cannot find 'model' in scope".
When in the past the model file for reasons unbeknownst to be finally is created, I can find swift files in ~/Library/Developer/Xcode/DerivedData/app-dir-guid/ matching the model name.
How is import and use of .mlpackage models supposed to work in Xcode? How to I force the necessary swift stubs for .mlpackage models to be generated?
$ sw_vers ProductName: macOS ProductVersion: 15.3 BuildVersion: 24D60
Xcode Version 16.2 (16C5032a)
I have a recurring problem using my ML model in Xcode. The model is created using tensorflow in .mlpackage format. I have dragged the .mlpackage directory from Finder into Xcode, removed it from "Compile Sources, but kept it in "Copy bundle resources".
When opening the "model.mlpackage" in Xcode, I see "Model class has not been generated yet". I take for granted the class file must exist.
I have tried repeated "Clean" and "build" but keep getting "Cannot find 'model' in scope".
When in the past the model file for reasons unbeknownst to be finally is created, I can find swift files in ~/Library/Developer/Xcode/DerivedData/app-dir-guid/ matching the model name.
How is import and use of .mlpackage models supposed to work in Xcode? How to I force the necessary swift stubs for .mlpackage models to be generated?
$ sw_vers ProductName: macOS ProductVersion: 15.3 BuildVersion: 24D60
Xcode Version 16.2 (16C5032a)
Share Improve this question asked Jan 31 at 9:10 Andreas FAndreas F 1711 silver badge9 bronze badges1 Answer
Reset to default 1"Dragging the .mlpackage directory from Finder into Xcode" works every time. You don't need to do anything else. Based on my Xcode 16.2, model.mlpackage shows up in "Compile Sources", not in "Copy bundle resources".
And you need model.mlpackage in "Compile Sources" to use compiler flags to support encrypted model. There are no compiler flags in "Copy bundle resources"
本文标签: iosHow to reliably import mlpackage machine learning model into XcodeStack Overflow
版权声明:本文标题:ios - How to reliably import .mlpackage machine learning model into Xcode - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745273090a2651015.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论