Skip to content Skip to sidebar Skip to footer

Mlmodel Works With Multiarray Output But Cannot Successfully Change The Output To An Image

I have converted a Keras model to a MLModel using coremltools 4.0 with limited success. It works but only if I use an MLMultiArray for the output and covert to an image. Converting

Solution 1:

In Core ML the order of the dimensions is (channels, height, width) so it expects to see a 3 x 2048 x 2048 output instead of 2048 x 2048 x 3.

Note that you also need to make sure the output pixels are in the range [0, 255] instead of [0, 1] which is probably what your Keras model gives you.

Post a Comment for "Mlmodel Works With Multiarray Output But Cannot Successfully Change The Output To An Image"