你好。
我正试着在Apple Watch 3上运行我的CoreML机型。现在我有大约160%的cpu使用率,所以我在识别方面有延迟。
有没有使用GPU的方法?
我正在尝试设置'useCPUOnly = false‘和MLModelConfiguration 'computeUnits = .all’。什么都没有用。
func prediction(data: MLMultiArray) throws -> ModelOutputProtocol {
let options = MLPredictionOptions()
options.usesCPUOnly = false
let input = ModelInput(windows: data)
return try prediction(input: input, options: options)
}
let config = MLModelConfiguration()
config.computeUnits = .all
try model = Model(contentsOf: url, configuration: config)在CPU使用率中,我看到的是160%,在GPU中,我看到的是0。
是的,我使用前台模式。
发布于 2020-06-13 03:59:33
我不认为Apple Watch 3有GPU,它可能只是向你展示了这一点,只是因为新的有。请参阅this维基页面。
https://stackoverflow.com/questions/62351422
复制相似问题