I'm in the process of having a pytorch model converted into coreml. It receives an image as input, onnx tools were used and it converts. Original and converted model does not produce same result for the same image, though.
Original model normalizes with mean and standard deviation (torchvision.transforms.Normalize(mean, std)) and this seems the best candidate as the source of differences. Is it possible to do it through coremltools parameters or do i have to do it "by hand" in pixel buffer or so?
Just forgot to mention that normalization is carried out per color channel.
Python source
from torchvision import transforms
IMAGE_NET_MEAN = [0.485, 0.456, 0.406]
IMAGE_NET_STD = [0.229, 0.224, 0.225]
class Transform:
def __init__(self):
normalize = transforms.Normalize(
mean=IMAGE_NET_MEAN,
std=IMAGE_NET_STD)
self._val_transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
normalize])
@property
def val_transform(self):
return self._val_transform
...
and before feeding the model
from nima.common import Transform
...
image = self.transform(image)
image = image.unsqueeze_(0)
image = image.to(device)
This issue might be more suited for the onnx-coreml repo. Might not hurt to open a corresponding issue there since it could be a bug in the onnx-coreml converter :)
I am not sure how the image normalization gets converted from Pytorch to ONNX. If its part of the ONNX model (most likely as an "ImageScaler" op) then it should be converted to CoreML as well. If its is skipped in ONNX then it would be a pre-processing step outside the model.
To debug, it might help to first import the converted ONNX model back to pytorch or Caffe2 and run it and check whether it matches the original predictions.
For the CoreML model, you might want to visualize it to see whether it has image pre-processing parameters baked in. See code snippet to print the pre-processing params: https://github.com/apple/coremltools/blob/e8b7655e0ef72a2a40075c6aad3453e253b94fb9/docs/APIExamples.md#printing-the-pre-processing-parameters
@aseemw correspondent issue was already filed
https://github.com/onnx/onnx-coreml/issues/338
I'll look to pre-processing parameters and continue posting in onnx-coreml repo.
@manuelcosta74, I have added an example as a Jupyter notebook in PR #246 on how to add per channel scale operation to an already converted mlmodel. It might be useful for your scenario.
@aseemw thanks!
@aseemw
did rename input and output features. It worked.
When model is used in xcode it shows input and output correctly, but it does not compile and the only error that i'm able to see is somewhere in the middle of the network (182). If i don't rename it, it compiles.
Input name(s) and shape(s):
input : (C,H,W) = (3, 224, 224)
Neural Network compiler 0: 245 , name = scale_layer, output shape : (C,H,W) = (3, 224, 224)
Neural Network compiler 1: 100 , name = 321, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 2: 160 , name = 322, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 3: 130 , name = 323, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 4: 100 , name = 324, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 5: 160 , name = 325, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 6: 130 , name = 326_scale_0_1, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 7: 130 , name = 326_clip_0_1, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 8: 130 , name = 326, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 9: 100 , name = 327, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 10: 160 , name = 328, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 11: 130 , name = 329_scale_0_1, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 12: 130 , name = 329_clip_0_1, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 13: 130 , name = 329, output shape : (C,H,W) = (32, 112, 112)
Neural Network compiler 14: 100 , name = 330, output shape : (C,H,W) = (16, 112, 112)
Neural Network compiler 15: 160 , name = 331, output shape : (C,H,W) = (16, 112, 112)
Neural Network compiler 16: 100 , name = 332, output shape : (C,H,W) = (96, 112, 112)
Neural Network compiler 17: 160 , name = 333, output shape : (C,H,W) = (96, 112, 112)
Neural Network compiler 18: 130 , name = 334_scale_0_1, output shape : (C,H,W) = (96, 112, 112)
Neural Network compiler 19: 130 , name = 334_clip_0_1, output shape : (C,H,W) = (96, 112, 112)
Neural Network compiler 20: 130 , name = 334, output shape : (C,H,W) = (96, 112, 112)
Neural Network compiler 21: 100 , name = 335, output shape : (C,H,W) = (96, 56, 56)
Neural Network compiler 22: 160 , name = 336, output shape : (C,H,W) = (96, 56, 56)
Neural Network compiler 23: 130 , name = 337_scale_0_1, output shape : (C,H,W) = (96, 56, 56)
Neural Network compiler 24: 130 , name = 337_clip_0_1, output shape : (C,H,W) = (96, 56, 56)
Neural Network compiler 25: 130 , name = 337, output shape : (C,H,W) = (96, 56, 56)
Neural Network compiler 26: 100 , name = 338, output shape : (C,H,W) = (24, 56, 56)
Neural Network compiler 27: 160 , name = 339, output shape : (C,H,W) = (24, 56, 56)
Neural Network compiler 28: 100 , name = 340, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 29: 160 , name = 341, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 30: 130 , name = 342_scale_0_1, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 31: 130 , name = 342_clip_0_1, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 32: 130 , name = 342, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 33: 100 , name = 343, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 34: 160 , name = 344, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 35: 130 , name = 345_scale_0_1, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 36: 130 , name = 345_clip_0_1, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 37: 130 , name = 345, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 38: 100 , name = 346, output shape : (C,H,W) = (24, 56, 56)
Neural Network compiler 39: 160 , name = 347, output shape : (C,H,W) = (24, 56, 56)
Neural Network compiler 40: 230 , name = 348, output shape : (C,H,W) = (24, 56, 56)
Neural Network compiler 41: 100 , name = 349, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 42: 160 , name = 350, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 43: 130 , name = 351_scale_0_1, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 44: 130 , name = 351_clip_0_1, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 45: 130 , name = 351, output shape : (C,H,W) = (144, 56, 56)
Neural Network compiler 46: 100 , name = 352, output shape : (C,H,W) = (144, 28, 28)
Neural Network compiler 47: 160 , name = 353, output shape : (C,H,W) = (144, 28, 28)
Neural Network compiler 48: 130 , name = 354_scale_0_1, output shape : (C,H,W) = (144, 28, 28)
Neural Network compiler 49: 130 , name = 354_clip_0_1, output shape : (C,H,W) = (144, 28, 28)
Neural Network compiler 50: 130 , name = 354, output shape : (C,H,W) = (144, 28, 28)
Neural Network compiler 51: 100 , name = 355, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 52: 160 , name = 356, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 53: 100 , name = 357, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 54: 160 , name = 358, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 55: 130 , name = 359_scale_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 56: 130 , name = 359_clip_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 57: 130 , name = 359, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 58: 100 , name = 360, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 59: 160 , name = 361, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 60: 130 , name = 362_scale_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 61: 130 , name = 362_clip_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 62: 130 , name = 362, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 63: 100 , name = 363, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 64: 160 , name = 364, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 65: 230 , name = 365, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 66: 100 , name = 366, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 67: 160 , name = 367, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 68: 130 , name = 368_scale_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 69: 130 , name = 368_clip_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 70: 130 , name = 368, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 71: 100 , name = 369, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 72: 160 , name = 370, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 73: 130 , name = 371_scale_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 74: 130 , name = 371_clip_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 75: 130 , name = 371, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 76: 100 , name = 372, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 77: 160 , name = 373, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 78: 230 , name = 374, output shape : (C,H,W) = (32, 28, 28)
Neural Network compiler 79: 100 , name = 375, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 80: 160 , name = 376, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 81: 130 , name = 377_scale_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 82: 130 , name = 377_clip_0_1, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 83: 130 , name = 377, output shape : (C,H,W) = (192, 28, 28)
Neural Network compiler 84: 100 , name = 378, output shape : (C,H,W) = (192, 14, 14)
Neural Network compiler 85: 160 , name = 379, output shape : (C,H,W) = (192, 14, 14)
Neural Network compiler 86: 130 , name = 380_scale_0_1, output shape : (C,H,W) = (192, 14, 14)
Neural Network compiler 87: 130 , name = 380_clip_0_1, output shape : (C,H,W) = (192, 14, 14)
Neural Network compiler 88: 130 , name = 380, output shape : (C,H,W) = (192, 14, 14)
Neural Network compiler 89: 100 , name = 381, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 90: 160 , name = 382, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 91: 100 , name = 383, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 92: 160 , name = 384, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 93: 130 , name = 385_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 94: 130 , name = 385_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 95: 130 , name = 385, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 96: 100 , name = 386, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 97: 160 , name = 387, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 98: 130 , name = 388_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 99: 130 , name = 388_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 100: 130 , name = 388, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 101: 100 , name = 389, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 102: 160 , name = 390, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 103: 230 , name = 391, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 104: 100 , name = 392, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 105: 160 , name = 393, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 106: 130 , name = 394_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 107: 130 , name = 394_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 108: 130 , name = 394, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 109: 100 , name = 395, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 110: 160 , name = 396, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 111: 130 , name = 397_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 112: 130 , name = 397_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 113: 130 , name = 397, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 114: 100 , name = 398, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 115: 160 , name = 399, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 116: 230 , name = 400, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 117: 100 , name = 401, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 118: 160 , name = 402, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 119: 130 , name = 403_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 120: 130 , name = 403_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 121: 130 , name = 403, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 122: 100 , name = 404, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 123: 160 , name = 405, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 124: 130 , name = 406_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 125: 130 , name = 406_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 126: 130 , name = 406, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 127: 100 , name = 407, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 128: 160 , name = 408, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 129: 230 , name = 409, output shape : (C,H,W) = (64, 14, 14)
Neural Network compiler 130: 100 , name = 410, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 131: 160 , name = 411, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 132: 130 , name = 412_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 133: 130 , name = 412_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 134: 130 , name = 412, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 135: 100 , name = 413, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 136: 160 , name = 414, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 137: 130 , name = 415_scale_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 138: 130 , name = 415_clip_0_1, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 139: 130 , name = 415, output shape : (C,H,W) = (384, 14, 14)
Neural Network compiler 140: 100 , name = 416, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 141: 160 , name = 417, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 142: 100 , name = 418, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 143: 160 , name = 419, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 144: 130 , name = 420_scale_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 145: 130 , name = 420_clip_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 146: 130 , name = 420, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 147: 100 , name = 421, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 148: 160 , name = 422, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 149: 130 , name = 423_scale_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 150: 130 , name = 423_clip_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 151: 130 , name = 423, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 152: 100 , name = 424, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 153: 160 , name = 425, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 154: 230 , name = 426, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 155: 100 , name = 427, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 156: 160 , name = 428, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 157: 130 , name = 429_scale_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 158: 130 , name = 429_clip_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 159: 130 , name = 429, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 160: 100 , name = 430, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 161: 160 , name = 431, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 162: 130 , name = 432_scale_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 163: 130 , name = 432_clip_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 164: 130 , name = 432, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 165: 100 , name = 433, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 166: 160 , name = 434, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 167: 230 , name = 435, output shape : (C,H,W) = (96, 14, 14)
Neural Network compiler 168: 100 , name = 436, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 169: 160 , name = 437, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 170: 130 , name = 438_scale_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 171: 130 , name = 438_clip_0_1, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 172: 130 , name = 438, output shape : (C,H,W) = (576, 14, 14)
Neural Network compiler 173: 100 , name = 439, output shape : (C,H,W) = (576, 7, 7)
Neural Network compiler 174: 160 , name = 440, output shape : (C,H,W) = (576, 7, 7)
Neural Network compiler 175: 130 , name = 441_scale_0_1, output shape : (C,H,W) = (576, 7, 7)
Neural Network compiler 176: 130 , name = 441_clip_0_1, output shape : (C,H,W) = (576, 7, 7)
Neural Network compiler 177: 130 , name = 441, output shape : (C,H,W) = (576, 7, 7)
Neural Network compiler 178: 100 , name = 442, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 179: 160 , name = 443, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 180: 100 , name = 444, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 181: 160 , name = 445, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 182: 130 , name = 446_scale_0_1, output shape : (C,H,W) = (960, 7, 7)coremlc: Error: compiler error: Unable to map image preprocessing feature name to any given image input name.
Neural Network compiler 183: 130 , name = 446_clip_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 184: 130 , name = 446, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 185: 100 , name = 447, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 186: 160 , name = 448, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 187: 130 , name = 449_scale_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 188: 130 , name = 449_clip_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 189: 130 , name = 449, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 190: 100 , name = 450, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 191: 160 , name = 451, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 192: 230 , name = 452, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 193: 100 , name = 453, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 194: 160 , name = 454, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 195: 130 , name = 455_scale_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 196: 130 , name = 455_clip_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 197: 130 , name = 455, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 198: 100 , name = 456, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 199: 160 , name = 457, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 200: 130 , name = 458_scale_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 201: 130 , name = 458_clip_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 202: 130 , name = 458, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 203: 100 , name = 459, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 204: 160 , name = 460, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 205: 230 , name = 461, output shape : (C,H,W) = (160, 7, 7)
Neural Network compiler 206: 100 , name = 462, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 207: 160 , name = 463, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 208: 130 , name = 464_scale_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 209: 130 , name = 464_clip_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 210: 130 , name = 464, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 211: 100 , name = 465, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 212: 160 , name = 466, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 213: 130 , name = 467_scale_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 214: 130 , name = 467_clip_0_1, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 215: 130 , name = 467, output shape : (C,H,W) = (960, 7, 7)
Neural Network compiler 216: 100 , name = 468, output shape : (C,H,W) = (320, 7, 7)
Neural Network compiler 217: 160 , name = 469, output shape : (C,H,W) = (320, 7, 7)
Neural Network compiler 218: 100 , name = 470, output shape : (C,H,W) = (1280, 7, 7)
Neural Network compiler 219: 160 , name = 471, output shape : (C,H,W) = (1280, 7, 7)
Neural Network compiler 220: 130 , name = 472, output shape : (C,H,W) = (1280, 7, 7)
Neural Network compiler 221: 200 , name = 473, output shape : (C,H,W) = (1280, 7, 7)
Neural Network compiler 222: 120 , name = 474, output shape : (C,H,W) = (1280, 1, 1)
Neural Network compiler 223: 301 , name = 482, output shape : (C,H,W) = (1280, 1, 1)
Neural Network compiler 224: 130 , name = 483, output shape : (C,H,W) = (1280, 1, 1)
Neural Network compiler 225: 140 , name = 486, output shape : (C,H,W) = (10, 1, 1)
Neural Network compiler 226: 175 , name = 487, output shape : (C,H,W) = (10, 1, 1)
Command CoreMLModelCompile failed with a nonzero exit code
The error is "Error: compiler error: Unable to map image preprocessing feature name to any given image input name".
This is happening because the "image_input_name" provided here was later renamed
So the preprocessing parameter has to be renamed as well. Actually this should have been done by the "rename_feature" function but it does not (this is a bug).
Just do this then:
spec.neuralNetwork.preprocessing[0].featureName = 'input'
It works! Thanks @aseemw again for helping out
Most helpful comment
The error is "Error: compiler error: Unable to map image preprocessing feature name to any given image input name".
This is happening because the "image_input_name" provided here was later renamed
So the preprocessing parameter has to be renamed as well. Actually this should have been done by the "rename_feature" function but it does not (this is a bug).
Just do this then:
spec.neuralNetwork.preprocessing[0].featureName = 'input'