Loading weights in TH format when keras is set to TF format
<p>I have Keras' <code>image_dim_ordering</code> property set to 'tf', so I define my models as this:</p>

<pre class="lang-js prettyprint-override"><code>model = Sequential()
model.add(ZeroPadding2D((1, 1), input_shape=(224, 224, 3)))
model.add(Convolution2D(64, 3, 3, activation='relu'))
</code></pre>

<p>But when I call <code>load_weights</code> method, it crashes because my model was saved using "th" format:</p>

<pre><code>Exception: Layer weight shape (3, 3, 3, 64) not compatible with provided weight shape (64, 3, 3, 3)
</code></pre>

<p>How can I load these weights and automatically transpose them to fix Tensorflow's format?</p>