title: How to convert keras tensorflow to keras mxnet
body: <p>I have a working python code in keras with tensorflow backend. I am utilizing transfer learning from VGG16. All is good.</p>
  
  <p>I want to use mxnet backend but had some issues:</p>
  
  <pre><code>from keras.preprocessing.image import ImageDataGenerator
  from keras import applications
  from helper import target_size, batch_size
  from math import ceil
  import numpy as np
  
  datagen = ImageDataGenerator(rescale=1./255)
  </code></pre>
  
  <blockquote>
    <p>loading vgg16 model, excluding the top fully connected layers</p>
  </blockquote>
  
  <pre><code>model = applications.VGG16(include_top=False, weights='imagenet' , input_shape=(224, 224 , 3))
  </code></pre>
  
  <p>above code (shape(224,224,3)) gives :</p>
  
  <blockquote>
    <p>ValueError: The input must have 3 channels; got <code>input_shape=(224, 224, 3)</code></p>
  </blockquote>
  
  <p>If I use : shape(3,224,24)</p>
  
  <blockquote>
    <p>'Redefinition of variable %s' % self.name
    AssertionError: Redefinition of variable block1_conv1/kernel1</p>
  </blockquote>
  
  <p>How can I properly use mxnet instead of tensorflow backend in working code?</p>
  
  <p>Note: keras.json:</p>
  
  <pre><code>{
  "epsilon": 1e-07, 
  "floatx": "float32", 
  "image_data_format": "channels_first", 
  "backend": "mxnet"
  }
  </code></pre>
  
  <h2>Edit 1</h2>
  
  <p>When I change the backend to mxnet from tensorflow is keras need to re-download vgg16 model for mxnet ? </p>