Closed b-hakim closed 5 years ago
Okay, I figured it out. In that piece of code (loading the data) the input has the following shape:
(batch_size, stack_size, height, weight, channels) -- (1)
However, the model is defined with the following channels:
def c3d_model(): input_shape = (112,112,16,3)
which will have at the end the following shape:
(batch_size, height, width, stack_size, channels) -- (2)
So to adjust the dimensions from (1) to (2), that is from the loaded data to the desired model input's format, we need to do that transpose which alternate the dimensions as shown here: https://stackoverflow.com/a/42154026/871418
I wonder why is the input transposed:
x = np.transpose(x, (0,2,3,1,4))
in both the val and the training stacks generation