title: Assign requires shapes of both tensors to match. lhs shape= [5] rhs shape= [1001]
body: <p>When I run the code in <a href="https://github.com/caicloud/tensorflow-tutorial/blob/master/Deep_Learning_with_TensorFlow/1.4.0/Chapter06/2.2%20fine_tuning.ipynb" rel="nofollow noreferrer">https://github.com/caicloud/tensorflow-tutorial/blob/master/Deep_Learning_with_TensorFlow/1.4.0/Chapter06/2.2%20fine_tuning.ipynb</a></p>
  
  <p>I got the error：</p>
  
  <p><code>InvalidArgumentError</code> (see above for traceback): 
  Assign requires shapes of both tensors to match. lhs shape= [5] rhs shape= [1001]</p>
  
  <p>[[Node: save/Assign_8 = Assign[T=DT_FLOAT, _class=["loc:@InceptionV3/AuxLogits/Conv2d_2b_1x1/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](InceptionV3/AuxLogits/Conv2d_2b_1x1/biases, save/RestoreV2_8)]]</p>
  
  <p>The var trainable_variables in this picture <a href="https://i.stack.imgur.com/xkRf5.png" rel="nofollow noreferrer">enter image description here</a> does not used ? </p>
  
  <p>How to fix it? </p>
  
  <p>main code for transfer learning:</p>
  
  <pre><code>images = tf.placeholder(tf.float32, [None, IMG_HEIGHT, IMG_WIDTH, CHANNELS], name='input_images')
  labels = tf.placeholder(tf.int64, [None], name='labels')
  
  #define the model
  with slim.arg_scope(inception_v3.inception_v3_arg_scope()):
      logits, _ = inception_v3.inception_v3(images, num_classes=N_CLASSES, is_training=True)
  
  # get the trainables_var with the function get_trainable_variables()
  trainable_variables = get_trainable_variables()
  tf.losses.softmax_cross_entropy(tf.one_hot(labels, N_CLASSES), logits, weights=1.0)
  train_step = tf.train.RMSPropOptimizer(LEARNING_RATE).minimize(tf.losses.get_total_loss())
  
  with tf.name_scope('evaluation'):
      correct_prediction = tf.equal(tf.argmax(logits, 1), labels)
      evaluation_step = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
  
  
  load_fn = slim.assign_from_checkpoint_fn(
                      CKPT_FILE,
                      get_tuned_variables(), ignore_missing_vars = True)
  
  saver = tf.train.Saver()
  with tf.Session() as sess:
      init = tf.global_variables_initializer()
      sess.run(init)
  
      print('Loading tuned_variables from %s'%CKPT_FILE)
      load_fn(sess)
  </code></pre>