TensorFlow-SRCNN
TensorFlow-SRCNN copied to clipboard
slice indices must be integers or None or have an __index__ method
To avoid this error: in utils.py in modcrop(img, scale =3):
add np.mod: if len(img.shape) ==3: h, w, _ = img.shape h = h - np.mod(h,scale) w = w - np.mod(w, scale) img = img[0:h, 0:w, :] else: h, w = img.shape h = h - np.mod(h, scale) w = w - np.mod(w,scale) img = img[0:h, 0:w] return img
Additionally, since the division in input_setup in: padding = abs(config.image_size - config.label_size) / 2 returns a float, padding cant be used as indexing as it is, so change to padding = int(abs(config.image_size - config.label_size) / 2)