An error ocurred while starting the kernel when I try to train my CNN model

Viewed 237

I really could need some help with tensorflow-gpu. My code runs with the regular tensorflow but encounters some problems when I try to run it with tensorflow-gpu.

I work with Windows 10 and I have a NVIDIA GeForce GTX 960 graphic card. I've just installed all requirements for tensorflow-gpu:

  • CUDA toolkit 11.0
  • cuDNN64_8.dll

To check if everything worked, I run the following code:

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

which gives me:

Num GPUs Available: 1

The code works until I want to train my model:

fashion_train = fashion_model.fit(train_X, train_label,
                                 batch_size = batch_size,
                                 epochs = epochs, verbose = 1,
                                 validation_data = (valid_X, valid_label))

The code above gives me "An error occurred while starting the kernel":

2021 01:52:38.369630: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll 2021 01:52:40.401715: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set 2021 01:52:40.403411: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library nvcuda.dll 2021 01:52:40.428625: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties: pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 960 computeCapability: 5.2 coreClock: 1.1775GHz coreCount: 8 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 104.46GiB/s 2021 01:52:40.431701: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll 2021 01:52:40.456029: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll 2021 01:52:40.456456: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll 2021 01:52:40.472699: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll 2021 01:52:40.476733: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll 2021 01:52:40.523003: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusolver64_10.dll 2021 01:52:40.537385: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll 2021 01:52:40.538605: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudnn64_8.dll 2021 01:52:40.539087: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0 2021 01:52:42.084736: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance‑critical operations: AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2021 01:52:42.086141: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties: pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 960 computeCapability: 5.2 coreClock: 1.1775GHz coreCount: 8 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 104.46GiB/s 2021 01:52:42.087394: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll 2021 01:52:42.087864: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll 2021 01:52:42.088345: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll 2021 01:52:42.088758: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll 2021 01:52:42.089221: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll 2021 01:52:42.089627: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusolver64_10.dll 2021 01:52:42.090068: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll 2021 01:52:42.090480: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudnn64_8.dll 2021 01:52:42.090915: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0 2021 01:52:42.666110: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix: 2021 01:52:42.666616: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0 2021 01:52:42.666925: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N 2021 01:52:42.667340: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1349 MB memory) ‑> physical GPU (device: 0, name: NVIDIA GeForce GTX 960, pci bus id: 0000:01:00.0, compute capability: 5.2) 2021 01:52:42.669370: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set 2021 01:52:50.354096: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2) 2021 01:52:50.854008: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll 2021 01:52:51.146123: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll 2021 01:52:51.153163: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudnn64_8.dll

0 Answers
Related