ResourceExhaustedError for Keras Convolutional layer while classifying fMRI data

kerem kurban Source

I have an issue with the classification of my 24x39x39 data. Even though I am using batch_size = 1 with 1 conv2D layer and 2 dense and 1 flatten layers. It was more at first but now it has come to a point of adding all those numbers together and giving an output :). My gpu memory should not be that low (GTX 980 with 2GB)

    fashion_model_3 = Sequential()
    fashion_model_3.add(Conv2D(24, kernel_size=(3, 3), strides=2,
                     activation='relu',
                     data_format = "channels_last",
                     input_shape=( 39, 39,1)))
    Dropout(0.5)
    # fashion_model_3.add(Conv2D(24, (3, 3), strides=2, activation='relu'))
    # Dropout(0.5)
    # fashion_model_3.add(Conv2D(24, (3, 3), activation='relu'))
    # Dropout(0.5)
    fashion_model_3.add(Flatten())
    fashion_model_3.add(Dense(10, activation='relu'))
    fashion_model_3.add(Dense(num_classes, activation='softmax'))

    # Compile
    fashion_model_3.compile(loss=keras.losses.categorical_crossentropy,
          optimizer='adam',
          metrics=['accuracy'])
    # Fit
    fashion_model_3.fit(X_mod2,y_mod,
      batch_size=1,
      epochs=4,
      validation_split = 0.2)
pythontensorflowmachine-learningkerasconvolutional-neural-network

Answers

comments powered by Disqus