Open 1651061080 opened 4 years ago
May I ask if you have solved it? I also made a mistake in the RGB network report
img = np.reshape(img,img.shape+(1,)) if (not flag_multi_class) else img改为img = np.reshape(img,img.shape) if (not flag_multi_class) else img
img = np.reshape(img,img.shape+(1,)) if (not flag_multi_class) else img改为img = np.reshape(img,img.shape) if (not flag_multi_class) else img
actually it can also be deleted , then the net will work
I think the code is wrong but I don't know how to fix it. I have made color images and color grids. After the above step to test the error. Hope everyone can help. def testGenerator(test_path,num_image = 21,target_size = (256,256),flag_multi_class = False,as_gray = True): for i in range(num_image): img = io.imread(os.path.join(test_path,"%d.png"%i),as_gray = as_gray) img = img / 255 img = trans.resize(img,target_size) img = np.reshape(img,img.shape+(1,)) if (not flag_multi_class) else img img = np.reshape(img,(1,)+img.shape) yield img