python - Tensorflow-gpu 问题(CUDA 运行时错误 : device kernel image is invalid)

标签 python tensorflow gpu nvidia

我有一个 python 虚拟环境 (conda),我在其中安装了 CUDA 工具包 10.1.243 和 tensorflow-gpu 2.3.0rc0。我的 CUDA 驱动程序是 11.0。
为了测试 tensorflow 是否正确安装到 GPU,我从 venv 中运行了一系列命令:tf.test.is_built_with_cuda()真的tf.config.list_physical_devices(‘GPU’)找到具有以下属性的设备 0:
pciBusID:0000:01:00.0 名称:Quadro M2000M 计算能力:5.0
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000,1000])))"tensorflow.python.framework.errors_impl.InternalError:GPU:0 上的 CUDA 运行时隐式初始化失败。状态:设备内核镜像无效
我不知道如何解决这个问题。我有一种感觉,这与修改编译有关,以便 tensorflow 支持我的设备(5.0)的计算能力,但我不确定如何继续。谢谢!!

最佳答案

我只是遇到了同样的问题。我使用以下命令将 Tensorflow2.3 版本降级到 2.2。

pip install --upgrade tensorflow==2.2
它现在正在工作,但速度很慢。

关于python - Tensorflow-gpu 问题(CUDA 运行时错误 : device kernel image is invalid),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63231021/

相关文章:

cuda - CUDA程序/设备的效率

python - TelegramBot,如何处理命令旁边的消息

python - 在 Mac 上安装 TensorFlow 时出现问题

opengl - VBO等使用的 "OpenGL memory"在哪里以及使用什么

python - 如何在 Tensorflow 训练期间将 [3751,4] 数据集密集并 reshape 为 [1,6] 数据集

tensorflow - 如何使用 tensorflow.Estimator 进行强化学习

c++ - OpenCV 3.4 C++ Cuda加速比CPU耗时更多

python - Numpy - 将列数据类型 (dtype) 分配给现有数组

python - generate_blob_sas 创建无效的 SAS token

Python 嵌套 `if else` 语句返回错误