VNImageRequestHandler duplicates observations for multiple unique model requests

Number:rdar://37376036 Date Originated:2/8/2018
Status:Open Resolved:
Product:iOS SDK Product Version:11.2.5
Classification:Other Bug Reproducible:Always


I have more than one CoreML Model. I want to use Vision and VNImageRequestHandler to perform classification on one image using each model. When I perform a collection of VNCoreMLRequests with a VNImageRequestHandler trained on one image, the observations for each request's completion handler are identical.

I am using an open source framework I built, Lumina, to do this. I have a master branch which works appropriately, and another branch that easily reproduces the issue, called "multipleModelErrors". The repo is available on GitHub at and the file where the bug is easy to reproduce is LuminaObjectRecognizer.swift. Please check each branch to diff the files and notice what is being refactored.

Steps to Reproduce:

1. Use the LuminaSample app provided in the GitHub Repo. (
2. Ensure that both MobileNet and SqueezeNet are being used on camera.streamingModelTypes.
3. Ensure that, on the sample app, "Uses CoreML" is selected and switched on
4. Start the camera
5. Point the camera at an object that is easy to recognize, such as a drink glass, or something.

Expected Results:
If you are using the master branch, you will see that both SqueezeNet and MobileNet return discrete results. Though not always correct, it is clear that each model returns different results.

Actual Results:
If you are using the "multipleModelErrors" branch, you will see that both models return identical results, despite being tagged as separate types.

iOS 11.2.5



Master branch with working file:

Error branch with refactored file that should work:

By david.m.okun at Feb. 9, 2018, 1:40 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!