TensorFlow到核心ML转换器投掷错误

时间:2017-12-08 15:03:36

标签: tensorflow

我正在使用TensorFlow到Core ML转换器将TensorFlow模型转换为Core ML。我不断收到断言错误,如下面的屏幕截图所示:

enter image description here

有什么想法吗?

2 个答案:

答案 0 :(得分:0)

尝试使用keras

coreml_model = coremltools.converters.keras.convert('./Any.h5',
                                            input_names='image',
                                            image_input_names='image',
                                            output_names='output',
                                            class_labels=['1', '2'],
                                            image_scale=1/255)
coreml_model.save('abc.mlmodel')

.h5可以通过' Sequential'

轻松创建

答案 1 :(得分:0)

尝试一下:

tf_converter.convert(tf_model_path = 'inception_v1_2016_08_28_frozen.pb',
                     mlmodel_path = 'InceptionV1.mlmodel',
                     output_feature_names = ['InceptionV1/Logits/Predictions/Softmax:0'])

您需要运行tf-coreml/utils/inspect_pb.py来获取所有节点的摘要,以获取输出节点的正确名称。在这种情况下,它是InceptionV1/Logits/Predictions/Softmax:0