如何解决尝试使用 coremltools 4.1 将模型转换为 coreml 不工作
我正在使用 coremltools 4.1 将我的模型转换为 coreml,由于某种原因,我收到此错误:TypeError: 'InputLayer' object is not iterable
和在线 coreml_model = coremltools.converters.keras.convert(model)。任何人都可以在我的代码中做错什么。谢谢您的帮助。这是我的片段。
import coremltools
coreml_model = coremltools.converters.keras.convert(model)
# setup the meta datas foor our coreml modal
coreml_model.author = 'Author'
coreml_model.license = 'MIT'
coreml_model.short_description = 'Predicts the character passed in as a number between 1-9.'
coreml_model.input_description['image'] = 'A 28x28 pixel grayscale image.'
coreml_model.output_description['output1'] = 'A Multiarray where the index with the greatest float value between 0 and 1 is the recognized number.'
coreml_model.save('NumberRecognition.mlmodel')
print('model converted')
解决方法
不要使用public RenderTexture CreateTexture()
{
RenderTexture rt = new RenderTexture(256,256,16,RenderTextureFormat.ARGB32);
rt.Create();
return rt;
}
,而是使用coremltools.converters.keras.convert
。有关详细信息,请参阅文档:https://coremltools.readme.io/docs/introductory-quickstart
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。