deconv 操作的文档说我们需要提供 output_shape。是否可以不提供形状张量的第一个元素?当我尝试在形状张量中提供 None 时(还请注意,值的形状具有 None 作为第一个元素),我收到一个类似于以下内容的错误:
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 276, in conv2d_transposeoutput_shape_ = ops.convert_to_tensor(output_shape, name="output_shape")
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 621, in convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 180, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 163, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 421, in make_tensor_proto
tensor_proto.string_val.extend([compat.as_bytes(x) for x in proto_values])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/compat.py", line 45, in as_bytes
(bytes_or_text,))
TypeError: Expected binary or unicode string, got None