asingh33 / CNNGestureRecognizer

Gesture recognition via CNN. Implemented in Keras + Tensorflow/Theano + OpenCV
MIT License
977 stars 357 forks source link

K.set_image_dim_ordering('th') assumes (channels, rows, cols) #45

Closed jhonatantirado closed 4 years ago

jhonatantirado commented 5 years ago

First of all, thanks for the amazing work.

Regarding the issue, title, in file gestureCNN.py, you have the following at line 28: K.set_image_dim_ordering('th')

If you want to use: K.set_image_dim_ordering('tf')

Then, in line 322, you should use: X_train.reshape(X_train.shape[0], img_rows, img_cols, img_channels)

Instead of: X_train = X_train.reshape(X_train.shape[0], img_channels, img_rows, img_cols)

That's why you get the error "ValueError: Negative dimension size caused by subtracting 3 from 1..."

I'll try to fix it and submit a pull request.

Check the following article for further reference: Keras backends

asingh33 commented 5 years ago

Sounds good !

asingh33 commented 4 years ago

Closing this issue, as it has been rootcaused now.