raise Exception("Invalid border mode: " + str(border_mode))
if dim_ordering not in {"th", "tf"}:
raise Exception("Unknown dim_ordering " + str(dim_ordering))
if dim_ordering == "tf":
x = x.dimshuffle((0, 3, 1, 2))
y = y.dimshuffle((0, 3, 1, 2))
After Change
if data_format is None:
data_format = k.image_data_format()
if data_format not in {"channels_first", "channels_last"}:
raise ValueError("Unknown data_format:", data_format)
assert pool_size[0] >= 1 and pool_size[1] >= 1