title: Tensorflow: How can I assign numpy pre-trained weights to subsections of graph?
body: <p>This is a simple thing which I just couldn't figure out how to do.</p>
  
  <p>I converted a pre-trained VGG caffe model to tensorflow using the github code from <a href="https://github.com/ethereon/caffe-tensorflow" rel="noreferrer">https://github.com/ethereon/caffe-tensorflow</a> and saved it to vgg16.npy...</p>
  
  <p>I then load the network to my sess default session as "net" using:</p>
  
  <pre><code>images = tf.placeholder(tf.float32, [1, 224, 224, 3])
  net = VGGNet_xavier({'data': images, 'label' : 1}) 
  with tf.Session() as sess:
    net.load("vgg16.npy", sess) 
  </code></pre>
  
  <p>After net.load, I get a graph with a list of tensors. I can access individual tensors per layer using net.layers['conv1_1']... to get weights and biases for the first VGG convolutional layer, etc.</p>
  
  <p>Now suppose that I make another graph that has as its first layer "h_conv1_b":</p>
  
  <pre><code>  W_conv1_b = weight_variable([3,3,3,64])
    b_conv1_b = bias_variable([64])
    h_conv1_b = tf.nn.relu(conv2d(im_batch, W_conv1_b) + b_conv1_b)
  </code></pre>
  
  <p>My question is -- how do you get to assign the pre-trained weights from net.layers['conv1_1'] to h_conv1_b ?? (both are now tensors)</p>