I have a model that I have converted after training in Keras. It takes a four-channel image and returns a 2-channel image of the same size (which is processed to create a mask, should a partiicular class of object be detected). The model is similar to the 2014 "Fully Convolutional Networks for Semantic Segmentation." CoreML sees the input picture and output as MLMultiArrays, and I can load test data into these.
The model works fine in Keras on Linux or Mac. I set aside an image for testing on various platforms, with a known "good" output.
Converting from Keras to CoreML succeeds, and I have run the resultant CoreML model in coremltools with the reference image. It delivers the correct result image, matching the results from Keras/TF. I added this .mlmodel resource to a test framework in XCode.
Using the same reference imagery, not only does it generate incorrect values on iOS, I get wildly different values depending on whether I am running on different iOS devices -- a simulator or on my iPad Pro (recent 10.5", aka A1701).
Are there operations in CoreML that are known to cause issues when running in iOS but that succeed in conversion and when running on Mac? This one is a real puzzler, since the static data and code are the same between these two different iOS runs, and have already been vetted in the Mac using the same mlmodel resource.
I might write an additional Swift-based test on the Mac I suppose, but if CoreMLTools says the resource is okay, I don't think that would get me any closer to running my model under iOS. Am I missing something, some special modality?