i am trying to train a CNN on CPU with a input of (102480,40,40,2) dimensions and output of (40,40). Before i trained a model using (102480,40,40) input and it worked perfectly. Now when i run the script systems memory usage increases until it needs more and my pc freezes. I only have 8 GB ram.
i tried adding this line to my code which did not help at all.
sess = tf.Session(config=tf.ConfigProto(inter_op_parallelism_threads=1, intra_op_parallelism_threads=1))
This is my model:
model = Sequential()
model.add(Conv2D(64,(3,3), input_shape = train_data.shape[1:]))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Conv2D(64,(3,3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Flatten())
model.add(Dense(64))
model.add(Activation('relu'))
model.add(Dense(1600))
model.add(Reshape((40,40)))
model.add(Activation('sigmoid'))
model.compile(loss='MSE',
optimizer='SGD',
metrics=['MAE'])
history = model.fit(train_data, train_target,
batch_size=256,
epochs=100,
validation_split=0.1,
callbacks = [cp_callback])
Can i somehow decrease the system memory usage without losing accuracy?