-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negative dimension size caused by subtracting 50 from 1 for 'depthwise_conv2d_5/depthwise' (op: 'DepthwiseConv2dNative') with input shapes: [?,1,50,8], [50,1,8,2]. #13
Comments
You'll need to change the Keras variable "image_data_format" to "channels_first". You can do this in one of two ways:
from tensorflow.keras import backend as K
K.set_image_data_format('channels_first') |
Many thanks, working now. |
Hi, The input, I have to your model is 273 trials because rest are discarded as bad trials, 22 channels, and from each trial, I only selected the data after the cue from 0s to 3s after cue. In code sample =750. In 273 trials, I kept 200 for training and 73 for validation. Results: I kept 100 epochs, training accuracy was 91% and validation was 73% which I think is higher than what you have said in your paper. I remember from 4 class you reported 44%. I am wondering is that on Session-1 data or you tested it in session-II data. |
So there are a couple of things to note:
So your results may still be right; having a larger window at [0,3]s could potentially improve classification performance. This is something I haven't really tested. |
Dear, Many thanks for your suggestions. I used Dataset 2A and trained on session 1 data and evaluated it in Session 2 data. The transitioning phase from one session to others has a covariate shift in the data for each subject. But, your model is working very well just changing a few parameters. |
Good to hear! Let me know if any other issues arise. |
Hello! I had the same problem, but when I put these lines from tensorflow.keras import backend as K K.set_image_data_format('channels_first'), I receive tensorflow.python.framework.errors_impl.InvalidArgumentError: Default AvgPoolingOp only supports NHWC on device type CPU. How could I solve this? |
@mariasapantan what version of tensorflow are you using and how did you install tensorflow? The above error comes up if you installed the CPU version of tensorflow through pip; i.e.
|
I'm not using Anaconda distribution and I have CPU version. I installed |
Yes I believe you should uninstall all previous versions of tensorflow and install intel-tensorflow. Then things "should" work out of the box. |
It seens like the tensorflow is uninstalled when I put |
So I ran a quick test using the from tensorflow.keras import backend as K
K.set_image_data_format('channels_first') you may have to restart your interpreter after you make package changes? I don't use pycharm so I'm not sure how to troubleshoot there.. Note I'm using Python 3.7, but I doubt this matters much whether you're on Python 3.7/3.8/etc. You should double-check if all tensorflow packages are uninstalled, then try to install Otherwise I'm not sure how to help from here.. |
I have AMD processor. I tried a lot of things, but it does not work for me. Could you help me via TeamViewer? |
I am using EEGNet model for classifying 4-class BCI competition IV Dataset 2a for Motor Imagery detection i.e. detecting (SMR)
I read the data for one subject using the MAT file I have. After reading the training data, the x
The output is :
where 272 are trials, 22 channels, 1500 samples from each trial
I partitioned and cropped the data. The cropping I did because the data in the region 500:1000 (i.e. from the start of the cue to the 2 sec after cue) is much related for ERD/ERS.
Output:
Following parameter, I used and reshaped the data
Output:
Now, while creating the model
Now the error, I am getting is given as follows:
ValueError: Negative dimension size caused by subtracting 22 from 8 for 'depthwise_conv2d/depthwise' (op: 'DepthwiseConv2dNative') with input shapes: [?,8,22,500], [22,1,500,2].
I am wondering what mistake I am making? any clue, please
Many thanks
The text was updated successfully, but these errors were encountered: