raise Exception("UpSampling2d tf.image.resize_images only support channel_last")
// if len(self.inputs.get_shape()) == 3:
if inputs.shape.ndims == 3:
if self.is_scale:
input_shape = inputs.shape.as_list()
if input_shape[0] is not None:
size_h = self.size[0] * input_shape[0]
else:
size_h = self.size[0] * tf.shape(input=inputs)[0]
if input_shape[1] is not None:
size_w = self.size[1] * input_shape[1]
else:
size_w = self.size[1] * tf.shape(input=inputs)[1]
self.size = [size_h, size_w]
// elif len(self.inputs.get_shape()) == 4:
elif inputs.shape.ndims == 4:
if self.is_scale:
input_shape = inputs.shape.as_list()
if input_shape[1] is not None:
size_h = self.size[0] * input_shape[1]
else:
size_h = self.size[0] * tf.shape(input=inputs)[1]
if input_shape[2] is not None:
size_w = self.size[1] * input_shape[2]
else:
size_w = self.size[1] * tf.shape(input=inputs)[2]
self.size = [size_h, size_w]
else:
raise Exception("Donot support shape %s" % str(inputs.shape.as_list()))
After Change
raise Exception("UpSampling2d tf.image.resize_images only support channel_last")
// if len(self.inputs.get_shape()) == 3:
if len(inputs_shape) == 3:
if self.is_scale:
// input_shape = inputs.shape.as_list()
if input_shape[0] is not None:
size_h = self.size[0] * input_shape[0]