title: How to setup coremltools convert model output shape using yolo.h5
body: <p>I try to convert <code>h5</code> to iOS <code>mlModel</code>.</p>
  
  <p>I follow Quick Start to get <code>h5</code> file by this link.</p>
  
  <p><a href="https://github.com/qqwweee/keras-yolo3" rel="nofollow noreferrer">https://github.com/qqwweee/keras-yolo3</a></p>
  
  <p>Then, I use <code>coremltools</code> to convert <code>h5</code> to <code>mlModel</code></p>
  
  <p>this is my code</p>
  
  <pre><code>mlModel = coremltools.converters.keras.convert('./yoloDone.h5',
                                              input_names='image',
                                              image_input_names='image',
                                              input_name_shape_dict={'image': [None, 416, 416, 3]})
  </code></pre>
  
  <p>But I find some error in output shape.</p>
  
  <p>This is correct output.</p>
  
  <p><a href="https://i.stack.imgur.com/R8PAZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R8PAZ.png" alt="enter image description here"></a></p>
  
  <p>This is my output, the type is not same.</p>
  
  <p><a href="https://i.stack.imgur.com/KZrn7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KZrn7.png" alt="enter image description here"></a></p>
  
  <p>The correct model, <code>output1</code> is 255x13x13.</p>
  
  <p>But my model, <code>output1</code> is 1x1x255x13x13.</p>
  
  <p>What should I do to edit ?</p>