vlawhern / arl-eegmodels

This is the Army Research Laboratory (ARL) EEGModels Project: A Collection of Convolutional Neural Network (CNN) models for EEG signal classification, using Keras and Tensorflow
Other
1.14k stars 284 forks source link

Trying to fit my data to the input shape #28

Closed MuSamiNaf closed 3 years ago

MuSamiNaf commented 3 years ago

Hello... I am tring to fit my data to the required shape

input1 = Input(shape = (Chans, Samples, 1))

I have data which is 17388 x 640 and it has been reshaped to 17388 x 32 x 20 x 1

However an error is issued

Exception has occurred: ValueError Negative dimension size caused by subtracting 8 from 5 for '{{node average_pooling2d_1/AvgPool}} = AvgPoolT=DT_FLOAT, data_format="NHWC", ksize=[1, 1, 8, 1], padding="VALID", strides=[1, 1, 8, 1]' with input shapes: [?,1,5,16].

May I know to proplery prepare my data to fit the EEGNet Model?

Thank you

vlawhern commented 3 years ago

This appears to be related to this previous issue (https://github.com/vlawhern/arl-eegmodels/issues/13). Please pull down the most recent version of the repo and ensure that you have the 'channels_last' variable set at the beginning of your code:

from tensorflow.keras import backend as K
K.set_image_data_format('channels_last')
vlawhern commented 3 years ago

Closing due to inactivity, but please feel free to reopen if needed.