fc3
with tf.name_scope('fc3') as scope:
fc3w = tf.Variable(tf.truncated_normal([4096, 1000],
dtype=tf.float32,
stddev=1e-1), name='weights')
fc3b = tf.Variable(tf.constant(1.0, shape=[1000], dtype=tf.float32),
trainable=True, name='biases')
self.fc3l = tf.nn.bias_add(tf.matmul(self.fc2, fc3w), fc3b)
self.layers[scope[:-1]] = self.fc3l
self.parameters += [fc3w, fc3b]
KeyError Traceback (most recent call last)
in
10
11 # 反向梯度计算
---> 12 signal = tf.multiply(vgg_load.layers['fc3'], one_hot)
13 loss = tf.reduce_mean(signal)
14 grads = tf.gradients(loss, conv_layer)[0]
KeyError: 'fc3'