I am currently trying to train a convolutional neural network with Tensorflow and Keras. I am new to convolutional neural networks The definition and compilation of the neural network is as follows:
def build_and_compile_model():
model = models.Sequential()
model.add(layers.Conv2D(1100, (3, 3), activation='relu', input_shape=(1100, 300, 1)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(550, (3, 3), activation='relu'))
model.add(layers.Flatten())
model.add(layers.Dense(100, activation='relu'))
model.add(layers.Dense(1))
model.summary()
model.compile(loss='mean_absolute_error', optimizer=tf.keras.optimizers.Adam(0.001), metrics=[tf.keras.metrics.RootMeanSquaredError()])
return model
model = build_and_compile_model()
I am aware the input size is quite large... The problem is that my computer freezes when running the above code, even before training, and I am not quite sure why. Searching for similar problems, I have unsuccessfully tried the following:
- Updating the BIOS
- Setting a GPU usage limit on tensorflow (How to prevent tensorflow from allocating the totality of a GPU memory?).
For all of them, their computer freezes during training but not compiling the model, so I thought about asking as there must be something fundamentally wrong with the model.
My PC is an ASUS X555LJ, i7, 12 Gb RAM. Version of tensorflow is 2.3.0.
Thanks in advance.