CreateML保存.mlmodel失败

时间:2019-03-10 09:09:26

标签: swift cocoa createml

我创建了Cocoa应用程序(不是游乐场),并尝试创建和保存MLRegressorModel。但是,当我尝试保存成功创建的.mlmodel时,出现错误:

Could not export model: validator error: unable to open file for write

错误,当我使用try时! :

Fatal error: 'try!' expression unexpectedly raised an error: CreateML.MLCreateError.generic(reason: "Saving .mlmodel failed.")

如何将.mlmodel保存到磁盘?现在,我使用代码:

let homePath = FileManager.default.homeDirectoryForCurrentUser
let desktopPath = homePath.appendingPathComponent("Desktop")
try! regressor.write(to: desktopPath.appendingPathComponent("Regressor.mlmodel"))

0 个答案:

没有答案