title: Error in converting keras model to core ml model
body: <p>I have been trying to convert the Keras model to the core mlmodel. However, while doing so, I get multiple inputs and outputs. I just want the following as input and output.</p>
  <pre><code>name: &quot;input&quot;
  type {  
      imageType {    
          width: 256    
          height: 64    
          colorSpace: GRAYSCALE  }
  }
  
  name: &quot;output&quot;
  type {
    dictionaryType {
      stringKeyType {
      }
    }
  }
  </code></pre>
  <p>The current model I get.</p>
  <pre><code>type {
    imageType {
      width: 256
      height: 64
      colorSpace: GRAYSCALE
    }
  }
  , name: &quot;lstm1_h_in&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  , name: &quot;lstm1_c_in&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  , name: &quot;lstm1_h_in_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  , name: &quot;lstm1_c_in_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  , name: &quot;lstm2_h_in&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  , name: &quot;lstm2_c_in&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  , name: &quot;lstm2_h_in_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  , name: &quot;lstm2_c_in_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
    isOptional: true
  }
  ]
  
  [name: &quot;output&quot;
  type {
    dictionaryType {
      stringKeyType {
      }
    }
  }
  , name: &quot;lstm1_h_out&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;lstm1_c_out&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;lstm1_h_out_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;lstm1_c_out_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;lstm2_h_out&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;lstm2_c_out&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;lstm2_h_out_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;lstm2_c_out_rev&quot;
  type {
    multiArrayType {
      shape: 256
      dataType: DOUBLE
    }
  }
  , name: &quot;classLabel&quot;
  type {
    stringType {
    }
  }
  ]
  
  </code></pre>
  <p>I am using this code to convert:</p>
  <pre><code>from keras.models import load_model
  import coremltools as ct
  
  class_labels = [&quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;, &quot;G&quot;, &quot;H&quot;, &quot;I&quot;, &quot;J&quot;, &quot;K&quot;,
                  &quot;L&quot;, &quot;M&quot;, &quot;N&quot;, &quot;O&quot;, &quot;P&quot;, &quot;Q&quot;, &quot;R&quot;, &quot;S&quot;, &quot;T&quot;, &quot;U&quot;, &quot;V&quot;, &quot;W&quot;, &quot;X&quot;, &quot;Y&quot;, &quot;Z&quot;, &quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;, &quot;f&quot;,
                  &quot;g&quot;, &quot;h&quot;, &quot;i&quot;, &quot;j&quot;, &quot;k&quot;, &quot;l&quot;, &quot;m&quot;, &quot;n&quot;, &quot;o&quot;, &quot;p&quot;, &quot;q&quot;, &quot;r&quot;, &quot;s&quot;, &quot;t&quot;, &quot;u&quot;, &quot;v&quot;, &quot;w&quot;, &quot;x&quot;, &quot;y&quot;, &quot;z&quot;, &quot;-&quot;]
  
  tf_keras_model = load_model(&quot;HTRAdam.h5&quot;)
  mlmodel = ct.converters.keras.convert('HTRAdam.h5', input_names=['image'], output_names=['output'],
                                                     class_labels=class_labels, image_input_names='image')
  mlmodel.save('HTR.mlmodel')
  </code></pre>
  <p>When I enter the image in this, I don't get any output. I mean image output is nil.
  I step into debug mode, but cannot find any error from model prediction.</p>
  <p>I am guessing the issue might be with the compiling model but I have no idea about how to resolve it.
  Thank you for your help.</p>