tensorflow(不是 tensorflow-gpu):调用 cuInit 失败:未知错误 (303)

新手上路,请多包涵

我的测试

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()

我的错误

2019-12-27 10:51:17.887009: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/openmpi/lib:
2019-12-27 10:51:17.888489: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2019-12-27 10:51:17.888992: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (3e7d899714a9): /proc/driver/nvidia/version does not exist
2019-12-27 10:51:17.890608: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-12-27 10:51:17.915554: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2904000000 Hz
2019-12-27 10:51:17.918061: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x56101fca67e0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2019-12-27 10:51:17.918228: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version

我的环境

乌布努图 18

张量流 1.15.0/1.14.0

我的问题

我已经审查了类似的问题,例如 TensorFlow:对 cuInit 的调用失败:CUDA_ERROR_NO_DEVICE

关键区别是我没有安装 tensorflow-gpu 包。正常的 TensorFlow 怎么会引发这个错误?

原文由 Henry Arnold 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.3k
1 个回答

您可以尝试使用 tensorflow-cpu 包而不是 tensorflow 来解决仅 cpu 机器上的这个问题。

 pip uninstall tensorflow
pip install tensorflow-cpu

原文由 dsalaj 发布,翻译遵循 CC BY-SA 4.0 许可协议

推荐问题