Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you deal with tf.space_to_depth during coreMLTool conversion? #48

Open
kechan opened this issue Jan 3, 2019 · 3 comments
Open

Comments

@kechan
Copy link

kechan commented Jan 3, 2019

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?

@hollance
Copy link
Owner

hollance commented Jan 3, 2019

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).

@kechan
Copy link
Author

kechan commented Jan 10, 2019

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.

@hollance
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants