当我尝试使用 coremltools 将模型从 Caffe 转换为 Core ML 模型时,我得到以下信息:
================= Starting Conversion from Caffe to CoreML ======================
Layer 0: Type: 'Data', Name: 'data'. Output(s): 'data', 'label'.
WARNING: Skipping Data Layer 'data' of type 'Data'. It is recommended to use Input layer for deployment.
Layer 1: Type: 'Split', Name: 'label_data_1_split'. Input(s): 'label'. Output(s): 'label_data_1_split_0', 'label_data_1_split_1'.
Layer 2: Type: 'Convolution', Name: 'conv1'. Input(s): 'data'. Output(s): 'conv1'.
Layer 3: Type: 'Slice', Name: 'slice1'. Input(s): 'conv1'. Output(s): 'slice1_1', 'slice1_2'.
Layer 4: Type: 'Eltwise', Name: 'etlwise1'. Input(s): 'slice1_1', 'slice1_2'. Output(s): 'eltwise1'.
Traceback (most recent call last):
File "test.py", line 2, in <module>
coreml_model = coremltools.converters.caffe.convert('_iter_3560000.caffemodel')
File "/Users/zfh/Desktop/face_verification_experiment/model/python27/lib/python2.7/site-packages/coremltools/converters/caffe/_caffe_converter.py", line 142, in convert
predicted_feature_name)
File "/Users/zfh/Desktop/face_verification_experiment/model/python27/lib/python2.7/site-packages/coremltools/converters/caffe/_caffe_converter.py", line 187, in _export
predicted_feature_name
RuntimeError: Unsupported option 'Max' for the parameter 'operation' in layer 'etlwise1' of type 'Elementwise' during caffe conversion.
这是我正在使用的代码:
import coremltools
coreml_model = coremltools.converters.caffe.convert(('_iter_3560000.caffemodel', 'LCNN_deploy.prototxt'))
coreml_model.save('_iter_3560000.mlmodel')
任何想法是什么问题?非常感谢!