简体   繁体   English

永久更改.mlmodel自动生成的文件

[英]Change .mlmodel auto-generated file forever

In my objective-c project, I use Core ML model for image recognition which generates objective-c .h/.m files for interaction with it. 在我的Objective-c项目中,我使用Core ML模型进行图像识别,该模型会生成Objective-c .h / .m文件以与其进行交互。

The problem is that this files contains syntax errors and is not compiled. 问题在于此文件包含语法错误,没有被编译。 I can fix them by myself and it will work if I run the app on simulator or device, but I can't create archive for AppStore, because during archiving the file with errors is created anew and build fails. 我可以自己修复它们,如果我在模拟器或设备上运行该应用程序,它将可以正常工作,但是我无法为AppStore创建存档 ,因为在存档文件时会错误地重新创建文件,并且构建失败。

So could you tell how can I solve this problem? 那你能告诉我如何解决这个问题吗?

PS: I took mlmodel from here PS:我从这里带了mlmodel

Error after archiving the project: 归档项目后出现错误: 在此处输入图片说明 The problem is that the name of the method misses underscores ("_"). 问题在于该方法的名称缺少下划线(“ _”)。 It may be fixed by renaming method like this: 可以通过这样的重命名方法来解决:

- (instancetype)initWithCategory_softmax_scores:(NSDictionary<NSString *, NSNumber *> *)category_softmax_scores category:(NSString *)category;

I've solved this problem by creating new class with the code from files (.h & .m), which generates mlmodel. 我已经通过使用文件(.h和.m)中的代码创建新类来解决此问题,该文件会生成mlmodel。 In this file I fixed all errors. 在此文件中,我修复了所有错误。 Next I've just imported my new file instead of previous (generated) and project has successfully archived. 接下来,我只是导入了新文件,而不是先前的文件(已生成),并且项目已成功存档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 框架在自动生成的 swift 文件中不可见 - Framework not visible in auto-generated swift file 如何使用Phonegap更改自动生成的窗口的位置? - How can I change the position of auto-generated windows with Phonegap? 如何编辑由 Firebase 动态链接自动生成的 apple-app-site-association 文件? - How to edit the apple-app-site-association file auto-generated by Firebase Dynamic Links? 关于通过核心数据自动生成代码的快速问题 - Quick question about auto-generated code via core data 自动生成的核心数据访问器返回已删除的对象 - Auto-generated Core Data accessor returns deleted objects 如何使用协议扩展为类提供自动生成的标识符? - How to use protocol extension to provide auto-generated identifier for classes? 自定义MLModel文件 - Custom MLModel File iOS CoreML mlmodel文件自动生成模型类文件的快速版本 - iOS CoreML mlmodel file auto-generates swift version of model class file 为什么自动生成的iOS Apple代码使用实例变量而不是属性? - Why does auto-generated iOS Apple code use instance variables instead of properties? Swift - 框架中的共享核心数据 - 自动生成的类不公开? - Swift - Shared Core Data in Framework - auto-generated classes aren't public?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM