gpt4 book ai didi

ios - CoreML 初始化失败 : MTLTextureDescriptor has width greater than the maximum allowed size

转载 作者:行者123 更新时间:2023-11-28 23:37:12 24 4
gpt4 key购买 nike

我有一个 Keras CNN 模型,我使用 coremltools 将其转换为 CoreML .它在模拟器上运行得很好,但在 iPhone X 上却不行。它只是在初始化时崩溃:

let cnn = MyCnn()

…有错误:

MTLTextureDescriptor has width (44100) greater than the maximum allowed size of 16384.

在阅读了具有类似错误的SO帖子后,我认为这可能是GPU问题,所以我尝试设置

usesCPUOnly = true 

但是,我只能在预测时间内发送选项,而且似乎没有办法在初始化之前设置它——崩溃发生的地方。

有什么想法我可以做什么吗?

最佳答案

可以在初始化期间通过传入MLModelConfiguration对象来设置它。

但是缩小模型可能是个好主意。听起来这对于手机来说太大了。

关于ios - CoreML 初始化失败 : MTLTextureDescriptor has width greater than the maximum allowed size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54610828/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com