下面是代码的简化版本,我在行中遇到错误 res = input - varimport tensorflow.contrib.slim as slimimport tensorflow as tfx = tf.placeholder(tf.float32, shape=[None, 150, 220, 3], name='x')input = slim.conv2d(x, num_outputs=96, kernel_size=11, stride=4, padding=padding, scope=scope, weights_initializer=tf.truncated_normal_initializer(stddev=0.01), biases_initializer=None, activation_fn=None)var = tf.zeros_initializer()res = input - var变量类型input type: <tensorflow.python.ops.init_ops.Zeros object at 0x7f1a017fdb38>var_type: Tensor("conv1/Conv2D:0", shape=(?, 35, 53, 96), dtype=float32)错误TypeError: Expected float32, got <tensorflow.python.ops.init_ops.Zeros object at 0x7f1a017fdb38> of type 'Zeros' instead.我该如何解决它,任何建议都会有所帮助。
添加回答
举报
0/150
提交
取消