title: TensorFlowInferenceInterface: Mobilenet for imagenet : java.io.IOException: Not a valid TensorFlow Graph serialization
body: <p>I am trying to run mobilenet model trained over imagenet on Android Tensorflow for object recognition and facing the issue as described below.</p>
  
  <pre><code> TensorFlowInferenceInterface: Failed to load model 
      from 'file:///android_asset/mobilenet_imagenet.pb': java.io.IOException: 
      Not a valid TensorFlow Graph serialization: 
      NodeDef mentions attr 'data_format' not in Op&lt;name=DepthwiseConv2dNative;
      signature=input:T, filter:T -&gt; output:T; 
      attr=T:type,allowed=[DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); 
      attr=padding:string,allowed=["SAME", "VALID"]&gt;; 
      NodeDef: conv_dw_1/depthwise = 
  DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1]]
      (conv1_relu/clip_by_value, conv_dw_1/depthwise_kernel/read)
  </code></pre>
  
  <p>I followed the tutorial as given in the <a href="https://blog.mindorks.com/android-tensorflow-machine-learning-example-ff0e9b2654cc" rel="nofollow noreferrer">link</a> to integrate Tensorflow on Android. I could run basic CNN classifier custom trained (using python 2.7.12, Tensorflow 1.2 on Ubuntu 16.04)and it is working fine.</p>
  
  <p>I could successfully run Mobilenet trained over imagenet on python 2.7.12 on Ubuntu 16.04 using Tensorflow 1.2 and 1.3. Now when I try to run the same '.pb' model on Android it gives me the error as mentioned above.</p>
  
  <p>The code for initializing the model is as given below :</p>
  
  <pre><code>TensorFlowImageClassifier c = new TensorFlowImageClassifier();
  c.inferenceInterface = new TensorFlowInferenceInterface();
  if (c.inferenceInterface.initializeTensorFlow(assetManager, modelFilename) != 0) {
           throw new RuntimeException("TF initialization failed");
  }
  </code></pre>
  
  <p>Please provide me a solution or a work around</p>