You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm stuck on changing the input type, I was able to change the type but when I load it into Xcode Project, I get a CoreML compile error.
# convert_inputType.py :convert multiArray to image typeimportcoremltoolsasctfromcoremltools.protoimportFeatureTypes_pb2asftspec=ct.utils.load_spec('model_coreml_float32.mlmodel') # miltiArray typebuilder=ct.models.neural_network.NeuralNetworkBuilder(spec=spec)
# check input/output featuresprint('--- Before change:')
builder.inspect_input_features()
builder.inspect_output_features()
# change the input so the model can accept 256x256 RGB imagesinput=spec.description.input[0]
input.type.imageType.colorSpace=ft.ImageFeatureType.RGBinput.type.imageType.width=256input.type.imageType.height=256# converted input/output featuresprint('--- After change:')
builder.inspect_input_features()
builder.inspect_output_features()
# save inputType-converted modelct.utils.save_spec(spec, 'selfie_segmentation.mlmodel') # changed type
Hellow Matthijs,
Your article has helped me a lot, thanks!, But now I'm stuck and need some clues.
I am trying to use a converted '.mlmodel' from Google MediaPipe '.tflite'.
I'm stuck on changing the input type, I was able to change the type but when I load it into Xcode Project, I get a CoreML compile error.
The following error occurs when loading the changed-type mlmodel into Xcode Peoject.
I have checked the model configuration with Newtron, and cannot find any nodes like (1,16,8,128) or (1,16,2,128)
Is there something wrong with the change code? Or does it have something to do with the fact that the original is a TFlite model?
Any hints on how to solve this problem?
The text was updated successfully, but these errors were encountered: