I am trying to build a neural network that will be able to do binary classification on a dataset. However, when I try to use the fit function with my model I get a window pop up saying "R Session Aborted. R encountered a fatal error. The session was terminated."
What could be causing it to crash?
The data set is 5 columns by 28200 rows. With one column being the target variable.
I have set tensorflow to version 1.4 as the newer versions apparently cause older computers such as mine to crash, but that has not fixed the problem.
As well as I used to get it crashing when I specified the layers but then I changed them and it no longer crashed until I tried to fit the model.
x_train <- as.matrix(training_set[,2:5])
y_train <- as.matrix(training_set[,1])
x_test <- as.matrix(test_set[,2:5])
y_test <- as.matrix(test_set[,1])
model <- keras_model_sequential()
model %>%
layer_dense(units = 32, activation = "relu", input_shape = c(4)) %>%
layer_dense(units = 1, activation = 'sigmoid')
model %>% compile(
loss = 'binary_crossentropy',
optimizer = 'rmsprop',
metrics = c('accuracy')
)
model %>% fit(
x_train, y_train,
batch_size = 32,
epochs = 10,
validation_data = list(x_test, y_test)
)