Keras 'Segmentation fault (core

I’m having issues with Keras and tensorflow. Basically, it gives me the following error “Segmentation fault (core dumped)” when I try to fit a model with a conv2d layer.

My code works on the CPU. It also works without any conv2d layers (even though it’s ineffective for my use case). I’ve got cuda, cudnn, and tensorflow installed. I’ve tried reinstalling keras and tensorflow. I’ve tried reinstalling the graphics drivers, CUDA, and all the other packages. I’m on Ubuntu 16.04 (Mint v18) with CUDA V9.0, and I simply followed the instructions on Tensorflow (under GPU support. for 1.12 and under.) to install CUDA. Tensorflow version is 1.12.

Code sample:

import numpy as np
import keras

model = keras.models.Sequential() #Sequential model type.
model.add(keras.layers.Conv2D(filters=1, kernel_size=(3,3), strides = 1, activation=“sigmoid”)) #Convolutional layer.
model.add(keras.layers.Flatten()) #Flatten layer.
model.add(keras.layers.Dense(4)) #Dense layer of 4 units.
model.compile(loss=‘mean_squared_error’, optimizer=‘adam’) #compile model.
y = np.random.rand(1,4) #Random expected output
x = np.random.rand(1, 38, 21, 1) # Random input.
model.fit(x, y) #And fit…
`

Error:

Using TensorFlow backend.
Epoch 1/1
2019-03-29 03:14:25.259882: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-03-29 03:14:25.573157: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-03-29 03:14:25.574989: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: GeForce RTX 2060 major: 7 minor: 5 memoryClockRate(GHz): 1.83
pciBusID: 0000:01:00.0
totalMemory: 5.73GiB freeMemory: 5.49GiB
2019-03-29 03:14:25.575033: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2019-03-29 03:14:31.770903: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-03-29 03:14:31.770974: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2019-03-29 03:14:31.770992: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2019-03-29 03:14:31.772113: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 5235 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2060, pci bus id: 0000:01:00.0, compute capability: 7.5)
Segmentation fault (core dumped)