Closed joe1chief closed 4 years ago
The way I have implemented this model makes it not flexible to modifications. Since the original implementation used 4 modalities, the model has layers with the number of kernels set according to that value, finally making the correct expected shapes at the output of each of the layers. If that value is changed, the pooling operations will return unexpected shapes and giving possibly 0 at one of the steps, making the layer shapes invalid (thus the error). Making this model flexible is one of the things I have had on my mind for a long time. I will get on it once I have some free time on my hands. Till then, if you want to, you can make it flexible all by yourself as well. ellisdg/3DUnetCNN has done a really nice job at creating a flexible 3D U-Net. A similar approach would be needed to rework this code into a flexible one.
I made the following changes for your example.
input_shape = (1, 80, 96, 64)
data[i] = np.array([preprocess(read_img(imgs['t1ce']), input_shape[1:])], dtype=np.float32)
and commentedin model.py.
But I got the following error.
Can you give me some hints to modify your code and give me an explanation for why assert (c % 4) == 0?