Closed nohboogy closed 5 years ago
I solved this problem while fixing code util.py
def to_rgb(img):
"""
Converts the given array into a RGB image. If the number of channels is not
3 the array is tiled such that it has 3 channels. Finally, the values are
rescaled to [0,255)
:param img: the array to convert [nx, ny, channels]
:returns img: the rgb image [nx, ny, 3]
"""
img = np.atleast_3d(img)
channels = img.shape[2]
if channels < 3:
img = np.tile(img, 3)
else:
img = img[:, :, 0:3]
img[np.isnan(img)] = 0
img -= np.amin(img)
if np.argmax(img) != 0:
img /= np.amax(img)
img *= 255
return img
I have a problem when I train it.
and this is the error message when I run it
I think this is because of size of channel but if I change the value of channel, another error message comes out.
Someone who can solve this problem?