在用jupyter lab跑CNN时,给我报了这个错误
在网上查了很多原因,都没法解决,又问了老师,老师说很多情况都有可能导致kernel崩溃,让我用pycharm来跑一下
用pycharm跑,就看出了问题:
2022-07-12 10:33:02.993081: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-07-12 10:33:03.650384: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3962 MB memory: -> device: 0, name: NVIDIA GeForce RTX 2060, pci bus id: 0000:01:00.0, compute capability: 7.5
Epoch 1/50
2022-07-12 10:33:05.914469: I tensorflow/stream_executor/cuda/cuda_dnn.cc:384] Loaded cuDNN version 8401
Process finished with exit code -1073740791 (0xC0000409)
这里可以看到使用的是GPU来做运算,程序退出了一个负数,但是不知道具体是什么错。
我们把这个Emulate terminal in output console打开
就可以看到详细的报错信息
Could not locate zlibwapi.dll. Please make sure it is in your library path!
所以就按照他说的做
下载链接
之后,将zlibwapi.dll 放到 环境变量 path 中(具体:…cuda…\bin)将zlibwapi.lib 放到 环境变量 path 中(具体:…cuda…\lib | lib64)
把这两个文件放到对应的cuda文件夹下之后,就可以跑起来了