I'm trying to use VGG, but input request 3 channels but my imput_shape'channel=1 I use nibabel to slice the MRI (nii)
ValueError: The input must have 3 channels; got input_shape=(256, 256, 1)
Here is my code about MRI slices.
code
images = []
images_ground = []
for f in range(len(g)):
a = nib.load(g[f])
a = a.get_data()
b = nib.load(g[f])
b = b.get_data()
a=a[:,:,48:166]
b = transform.resize(b, (64, 64, 256))
b=b[:,:,48:166]
for i in range(a.shape[2]):
images_ground.append(a[:,:,i])
images.append(b[:, :, i])
images_ground = np.array(images_ground)
images_ground = images_ground.reshape(-1, 256, 256, 1)
images = np.array(images)
images = images.reshape(-1, 64, 64, 1)
m = np.max(images)
mi = np.min(images)
images = (images - mi) / (m - mi)
n=np.max(images_ground)
ni=np.min(images_ground)
images_ground=(images_ground-ni)/(n-ni)
return images,images_ground