如何在iOS中使用Tensorflow训练的机器学习模型

时间:2017-08-23 11:54:59

标签: ios machine-learning tensorflow neural-network coreml

我正在尝试识别使用Tensorflow训练过的图像。我跟着这个steps 最后我成功地训练了我自己的数据集,并给出了一个很好的预测结果。所有代码都在python中。现在我想在我的iOS项目中使用这个训练有素的模型。我正在关注此tutorial以在我的iOS项目中使用我训练过的模型。但是当我按照这些步骤操作时,我的mac终端窗口出现错误,如 -

"ERROR: /tensorflow/tensorflow/core/kernels/BUILD:2235:1: C++ compilation of rule '//tensorflow/core/kernels:self_adjoint_eig_v2_op' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 124 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4. gcc: internal compiler error: Killed (program cc1plus)"

这个问题的解决方案是什么,或者有没有办法将此张量流模型转换为iOS支持的Core ML模型?在这里,我分享了该错误的屏幕截图。请帮帮我。感谢。

enter image description here

1 个答案:

答案 0 :(得分:0)

这很可能是因为docker容器内的内存不足,因为bazel使用默认参数运行。尝试使用这些额外标志重新运行(在bazel clean之后)构建命令:--local_resources 2048,2.0,1.0 -j 1。您还可以尝试提供更多资源:--local_resources 4096,2.0,1.0 -j 1

以下是此问题的一些链接:https://github.com/tensorflow/tensorflow/issues/1530 Tensorflow Serving Compile Error Using Docker on OSX

相关问题