Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow 如何正确使用tfcoreml?_Tensorflow_Coreml_Generative Adversarial Network - Fatal编程技术网

Tensorflow 如何正确使用tfcoreml?

Tensorflow 如何正确使用tfcoreml?,tensorflow,coreml,generative-adversarial-network,Tensorflow,Coreml,Generative Adversarial Network,我想将tensorflow模型()转换为coreml模型,以便能够在iOS上导入它 我知道要执行转换,使用这段代码就足够了: import tfcoreml as tf_converter tf_converter.convert(tf_model_path = 'my_model.pb', mlmodel_path = 'my_model.mlmodel', output_feature_names =

我想将tensorflow模型()转换为coreml模型,以便能够在iOS上导入它

我知道要执行转换,使用这段代码就足够了:

import tfcoreml as tf_converter

tf_converter.convert(tf_model_path = 'my_model.pb', 
                     mlmodel_path = 'my_model.mlmodel', 
                     output_feature_names = ['softmax:0'])

但是我不知道在第三个参数“output\u feature\u names”中放什么。有什么想法吗?

如果用打开.pb文件并一直滚动到底部,您将看到最后一层是EncodeJpeg,因此输出功能名称将是
EncodeJpeg:0

但是,Core ML没有“encode jpeg”操作,因此无法转换整个图形。您需要找到Core ML仍然支持的最后一个张量


我会尝试
output\u feature\u names=[“G\u 7/output/Tanh:0”]
但图形中很可能还有其他无法转换的东西。

ValueError:图形有循环。这意味着您无法将此模型转换为核心ML 2。但是,CoreMl3将支持这种功能,因此您可以尝试使用coremltools 3.0(目前仍处于测试阶段)。关于如何操作或寻找什么工具,您有什么想法吗?请参阅的文档--它解释了如何安装测试版。