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

build succeed but crash #2

Open
LYToToTo opened this issue Jun 8, 2017 · 14 comments
Open

build succeed but crash #2

LYToToTo opened this issue Jun 8, 2017 · 14 comments

Comments

@LYToToTo
Copy link

LYToToTo commented Jun 8, 2017

a7a2f8b6-ab5a-4182-9d73-54788dcce4e9

@hollance
Copy link
Owner

hollance commented Jun 8, 2017

Nice! Are you running this on an actual device?

I don't have an iOS 11 compatible device just yet so I only ran it in the simulator. But I was actually wondering if this would happen on the device.

You see, MobileNets uses a "depthwise convolution" and Metal does not support this currently.

The original model is trained in Caffe and that also doesn't support depthwise convolution. So they set the "groups" property of a regular convolution layer to be the same as the number of output channels, and then it works.

However... in Metal the number of input channels in each group must be a multiple of 4 (as the error message says). But when you set groups == output channels, the number of input channels in each group is 1. And Metal does not accept that.

So here we have a model that works OK on the simulator (where it uses Accelerate instead of Metal Performance Shaders) but not on the GPU.

I will submit this as a bug report to Apple. Thanks for pointing this out!

@gwangsc
Copy link

gwangsc commented Jun 8, 2017

Crashed at the same place. Running on a iphone7 plus, ios 11.0.

@flyingtango
Copy link

Crashed at the same place. ipad pro 9.7, ios 11.0.

@austingg
Copy link

austingg commented Jun 12, 2017

@hollance There are TF implemented MobileNet , and the depthwise conv is not implemented with group, I wonder whether that model would work.

@hollance
Copy link
Owner

@austingg There is no way to convert TensorFlow models to Core ML at the moment (only Keras models). In addition, the mlmodel format does not support depthwise convolution, so even if it were possible to convert TensorFlow, Core ML wouldn't know what to do with these layers.

@austingg
Copy link

@hollance thanks, that's pity, mlmodel is still limited to basic cnn classication application. we should still implemente some unspported layer by metal.

@gwangsc
Copy link

gwangsc commented Jun 13, 2017

I think CoreML can leave some interface or callback to allow developers to implement their own layer, and integrate into the CoreML pipeline. As long as they provide interface spec, and user provide kernels based on the spec, it should be doable.

Otherwise, CoreML won't be very useful given the fact that DL field evolves so fast and new layers/networks coming out almost on a monthly basis.

And also, the model size is a real problem. for the 4 models provided on Apple's website, non of them are smaller than 10MB. How could an app developer ship an App with a model about 50~100MB.

@hollance
Copy link
Owner

@gwangsc I agree. Please file a feature request at https://bugreport.apple.com -- that's the only way Apple will listen...

@XBeg9
Copy link

XBeg9 commented Jun 26, 2017

Any updates here? Could you please post a link to bugreport, I want to track it. Thanks!

@hollance
Copy link
Owner

It works on the device now with beta 2, but I'm not sure yet if that's because the model now runs on CPU instead of the GPU, or that Metal uses a workaround for this issue.

@XBeg9
Copy link

XBeg9 commented Jun 27, 2017

@hollance I think it's easy to check in Instruments

@hollance
Copy link
Owner

@XBeg9 I haven't had much luck with Instruments and compute shaders. But with GPU Frame Capture in Xcode it should be possible to check. I just haven't had the time for it yet.

@Shoshin23
Copy link

This seems to be resolved in iOS 11 public beta too. I still have to check whether it's running on the CPU or GPU. I shall do that in a few hours.

@huangxf14
Copy link

Is there any update for this problem? I still meet this bug now.

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

8 participants