Closed Manigandanv closed 6 years ago
the input to network must to be rank 4, that is [bathsize, height, width, channel] or something like this. but your input is rank 5. maybe this is the reason
thanks for your comment but for a 3d convolutional neural network the input tensor is 5d then how can i preprocess?
You have to write your own ImageDataGenerator. https://github.com/fchollet/keras/issues/2939
Start with making a copy of the class: https://github.com/fchollet/keras/blob/cebf2084ebb0a603383ceb6807653921796cd095/keras/preprocessing/image.py#L342 Then modify it to work with 3d data.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.
I do use ImageDataGenerator to get my training and testing data and then fed them into the netwrok with input_shape = (100, 100, 16, 1). still there is an error says expecting 5d input but found 4d. I know 3D CNN need 5d shape but how can I reshape the train_data whcih yields from ImageDataGenerator? wish to get your help .. thanks
https://gist.github.com/Emadeldeen-24/736c33ac2af0c00cc48810ad62e1f54a Here is an imagedatagenerator for 5D input to Conv3D nets. Hope it helps.
from tweaked_ImageGenerator_v2 import ImageDataGenerator
datagen = ImageDataGenerator()
train_data=datagen.flow_from_directory('path/to/data', target_size=(x, y), batch_size=32, frames_per_step=4)