我正在努力使this repo运行
我发现这个{a2}还没有解决,也指出了我的问题。 我使用的是Tensorflow 1.13.1(也尝试了1.14)和python 3
我得到的错误在depthwise_conv2d中:
"input tensor must have rank %d at least" % (expected_input_rank))
ValueError: input tensor must have rank 5 at least
检查张量时,我得到以下结果:
input tensor: Tensor("network/concat:0", shape=(?, 180, 270, 304), dtype=float32)
filters: <tf.Variable 'network/slim_decoder/conv2d/weights:0' shape=(3, 3, 304, 1) dtype=float32_ref>
以下是函数的定义:
@add_arg_scope
def depthwise_conv2d(
inputs, filters, bias=None,
strides=list([1, 1, 1, 1]), padding='SAME', dilations=list([1, 1, 1, 1]),
to_batch_norm=False, batch_norm_decay=0.997, is_training=True, activation_fn=None, name=None
):
if isinstance(strides, int):
strides = list([1, strides, strides, 1])
if isinstance(dilations, int):
dilations = list([1, dilations, dilations, 1])
print("input tensor: " + inputs)
print("filters: " + filters)
output = tf.nn.depthwise_conv2d(
input=inputs,
filter=filters,
strides=strides,
padding=padding,
rate=dilations,
name=name
)
if bias is not None:
output = tf.nn.bias_add(output, bias)
if to_batch_norm:
output = batch_norm(output, is_training, batch_norm_decay)
if activation_fn is not None:
output = activation_fn(output)
return output
我迷路了,非常感谢您的帮助,谢谢
尝试将膨胀参数从[1,1,1,1]更改为[1,1] tensorflow,2个列表除外
相关问题 更多 >
编程相关推荐