[英]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.