title: Tensorflow Hub: Fine-tune and evaluate
body: <p>Let's say that I want to fine tune one of the Tensorflow Hub image feature vector modules. The problem arises because in order to fine-tune a module, the following needs to be done:</p>
  
  <pre><code>module = hub.Module("https://tfhub.dev/google/imagenet/resnet_v2_50/feature_vector/3", trainable=True, tags={"train"})
  </code></pre>
  
  <p>Assuming that the module is <code>Resnet50</code>.</p>
  
  <p>In other words, the module is imported with the <code>trainable</code> flag set as <code>True</code> and with the <code>train tag</code>. Now, in case I want to validate the model (perform inference on the validation set in order to measure the performance of the model), I can't switch off the batch-norm because of the <code>train tag</code> and the <code>trainable</code> flag.</p>
  
  <p>Please note that this question has already been asked here <a href="https://stackoverflow.com/questions/53849214/tensorflow-hub-fine-tune-and-evaluate">Tensorflow hub fine-tune and evaluate</a> but no answer has been provided.</p>
  
  <p>I also raised a <a href="https://github.com/tensorflow/hub/issues/336" rel="nofollow noreferrer">Github issue about it</a> issue about it.</p>
  
  <p>Looking forward to your help!</p>