下面是一个代码片段,它试图命名张量操作的结果 所以我可以在网络被保存和恢复后访问它
def createForward(self):
# forward propogation
Z = tf.add(tf.matmul(self.W,self.prevLayer.A),self.b)
self.Z = tf.nn.dropout(Z,self.keepProb,name = self.name+'_Z')
print(self.name+'_Z',self.Z)
什么时候姓名是'output'我希望打印语句打印出来
output_Z Tensor("output_Z:0", shape=(3, ?), dtype=float32)
我真正得到的是
output_Z Tensor("output_Z/mul:0", shape=(3, ?), dtype=float32)
有人能解释一下发生了什么事吗。你知道吗
谢谢
我认为您不熟悉的是TensorFlow中操作的命名。让我们先看看这个:
如您所见,z的名称与操作z的名称不同,但它们都附加了操作名称
mul
。你知道吗为了得到你所期望的,你可以这样做:
Reference:
相关问题 更多 >
编程相关推荐