with tf.variable_scope('conv1', reuse=True) as scope_conv:
    W_conv1 = tf.get_variable('weights', shape=[5, 5, 1, 32])
weights = W_conv1.eval()
with open('conv1.weights.npz', 'w') as outfile:
    np.save(outfile, weights)
How can I visualize the weights(variables) in cnn in Tensorflow?