Unable to load CoreML model using MLModel.compileModel

霸气de小男生 提交于 2019-12-11 06:35:46

问题


The CoreML couldn't be loaded. The first line is successful, but the second line gives an error called: The file couldn’t be saved. The model does exist and modelUrl is correct. The same issue is also found here Unable to load CoreML model using MLModel.compileModel(at:)

Does someone know what the cause is?

var modelUrl = NSBundle.MainBundle.GetUrlForResource("SentimentPolarity", "mlmodel");
var compiledModelUrl = MLModel.CompileModel(modelUrl, out var error);

回答1:


I found the answer just now. I encountered this problem when I deploy an app to an iphone from Mac in debug mode. Actually, there is nothing wrong with the code, it is something else. I did two things, first sign in to icloud(does icloud have anything to do with the iphone's provisioning profile for development?), secondly delete the app and re-deploy the app to the iphone. It solves the problem now. Although I am not sure which one solves my problem, I assume it is the second thing I did. Let me know if anyone found the reason behind.



来源:https://stackoverflow.com/questions/56895366/unable-to-load-coreml-model-using-mlmodel-compilemodel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!