Open kechan opened 5 years ago
You need to convert this lambda layer into something CoreML understands. I think Core ML supports space-to-depth, so you’d need to insert such a layer manually at that point. See the tfcoreml examples on how to use custom layers to do this (you’d let tfcoreml insert a custom layer, which I think you already did, then replace this afterwards with the Core ML space-to-depth layer).
Thanks. May I ask where is this "tfcoreml example" you are referring to? In-between, I actually wrote my own in Accelerate, but it may be very suboptimal.
It’s in the tfcoreml repo: https://github.com/tf-coreml/tf-coreml/blob/master/examples/custom_layer_examples.ipynb
This is about yolo v2 (not the tiny).
The coreMLTool python part ran without any error generating the .mlmodel file. But when I dropped this into my Xcode project, I got an error:
There was a problem decoding this CoreML document validator error: Custom layer lambda_1 has an empty 'className' field. This field is required in order for Core ML to link to the implementation for this custom class.
The lambda_1 is the custom layer that calls tf.space_to_depth(x, block_size=2). Do you have any suggestion on what to do?