导出CNN第一层输出

时间:2018-07-24 19:59:07

标签: tensorflow conv-neural-network

我正在尝试研究标准CIFAR-10模型(https://github.com/tensorflow/models/tree/master/tutorials/image/cifar10/)。我想了解每一层并查看她的输出。例如-在推理方法(也用于训练)中,第一层是这样写的:

with tf.variable_scope('conv1') as scope:
kernel = _variable_with_weight_decay('weights',
                                     shape=[5, 5, 3, 64],
                                     stddev=5e-2,
                                     wd=None)
conv = tf.nn.conv2d(images, kernel, [1, 1, 1, 1], padding='SAME')
biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.0))
pre_activation = tf.nn.bias_add(conv, biases)
conv1 = tf.nn.relu(pre_activation, name=scope.name)
_activation_summary(conv1)

所以我想添加一行:

    layer1result=tf.sessions.run(conv1(images))

它将工作,我会得到我需要的东西吗?

谢谢!

0 个答案:

没有答案