super(Cropping3D, self).__init__(**kwargs)
if data_format == "default":
data_format = K.image_data_format()
self.cropping = tuple(cropping)
if len(self.cropping) != 3:
raise ValueError("`cropping` must be a tuple length of 3.")
if len(self.cropping[0]) != 2:
raise ValueError("`cropping[0]` must be a tuple length of 2.")
if len(self.cropping[1]) != 2:
raise ValueError("`cropping[1]` must be a tuple length of 2.")
if len(self.cropping[2]) != 2:
raise ValueError("`cropping[2]` must be a tuple length of 2.")
if data_format not in {"channels_last", "channels_first"}:
raise ValueError("data_format must be in {"channels_last", "channels_first"}.")
self.data_format = data_format
self.input_spec = [InputSpec(ndim=5)]
After Change
if hasattr(cropping, "__len__"):
if len(cropping) != 3:
raise ValueError("TODO")
dim1_cropping = conv_utils.normalize_tuple(cropping[0], 2,
"1st entry of cropping")
dim2_cropping = conv_utils.normalize_tuple(cropping[1], 2,
"2nd entry of cropping")