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

Insufficient Permission (to submit GPU work from background) when running MobileNetV2+SSDLite code with my own model #3

Open
MarkTension opened this issue Jan 22, 2019 · 5 comments

Comments

@MarkTension
Copy link

Hi there!
Really appreciate your work on explaining CoreML. Super useful!
I cloned your repository to learn about implementing CoreML and to find out how well my SSD_mobilenet_V1 trained on one class via tensorflow object detection API works. I replaced your MobileNetV2_SSDLite.mlmodel with my MobileNetV1_SSD.mlmodel, and changed the coreMLModel variable in the viewcontroller.

Unfortunately it doesn't work. The console output lists two problems:

  • Insufficient Permission (to submit GPU work from background)
  • Shape (91 x 1 x 1917) was not in enumerated set of allowed shapes
    I find the last error extra strange, since I can't find out where 91 (which is the number of coco classes I assume) comes from, and how I can change it.

The example does work with the originally supplied mobilenet_V2. I'm running on iOS12.
I've verified my model's accuracy on tensorboard, which is quite good, and I've followed your tutorial to convert it to .mlmodel and made sure to change the code for my one-class model.

Failed to perform Vision request: Error Domain=com.apple.vis Code=3 "The VNCoreMLTransform request failed" UserInfo={NSLocalizedDescription=The VNCoreMLTransform request failed, NSUnderlyingError=0x28019f2d0 {Error Domain=com.apple.CoreML Code=0 "Failed to evaluatue model 1 in pipeline" UserInfo={NSLocalizedDescription=Failed to evaluatue model 1 in pipeline, NSUnderlyingError=0x28019e910 {Error Domain=com.apple.CoreML Code=0 "Shape (91 x 1 x 1917) was not in enumerated set of allowed shapes" UserInfo={NSLocalizedDescription=Shape (91 x 1 x 1917) was not in enumerated set of allowed shapes}}}}} 2019-01-22 13:09:23.913001+0100 ObjectDetection[1428:73469] Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) 2019-01-22 13:09:23.913428+0100 ObjectDetection[1428:73469] Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) Error: command buffer exited with error status. The Metal Performance Shaders operations encoded on it may not have completed. Error: (null) Insufficient Permission (to submit GPU work from background) (IOAF code 6) <AGXA9FamilyCommandBuffer: 0x12fd4ab00> label = <none> device = <AGXA9Device: 0x105818000> name = Apple A9 GPU commandQueue = <AGXA9FamilyCommandQueue: 0x12fe1a5a0> label = <none> device = <AGXA9Device: 0x105818000> name = Apple A9 GPU retainedReferences = 1

@hollance
Copy link
Owner

Are you trying to run the model while the app is backgrounded?

91 is indeed the number of COCO classes + the background.

@MarkTension
Copy link
Author

I'm not, interestingly enough. Only change made to the code was swap models, and changed to the new model's name. Is the 91 defined somewhere in the app's code? Can't seem to find it. Model's specs seem alright? Or have I probably messed up my model in some way?
screenshot

@hollance
Copy link
Owner

That 91 is somewhere in your model.

@MarkTension
Copy link
Author

MarkTension commented Jan 23, 2019

Riight! Thanks. Turned out I forgot to change the number of classes in the training config file, while setting number of classes in the .pb to .mlmodel conversion to 1.
Interestingly enough, it also solved the GPU on the background error, and my model worked!

@hollance
Copy link
Owner

Good to hear. That "GPU on background" error was probably just a misleading error message that was triggered by the error with the shapes.

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