Hen*_*old 14 python tensorflow
我的测试
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
Run Code Online (Sandbox Code Playgroud)
我的错误
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
Run Code Online (Sandbox Code Playgroud)
我的环境
乌布努图 18
张量流 1.15.0/1.14.0
我的问题
我已经审查了类似的问题,例如TensorFlow : failed call to cuInit: CUDA_ERROR_NO_DEVICE
关键的区别是我没有tensorflow-gpu安装软件包。普通的 TensorFlow 怎么会出现这个错误?
dsa*_*laj 12
您可以尝试在仅使用 cpu 的机器上通过使用tensorflow-cpu包而不是tensorflow.
pip uninstall tensorflow
pip install tensorflow-cpu
Run Code Online (Sandbox Code Playgroud)
安装nvidia-modprobe可以解决这个问题。
sudo apt install nvidia-modprobe
Run Code Online (Sandbox Code Playgroud)
您可以尝试的其他解决方案是:
问题也可能是/dev/nvidia*在使用 sudo 运行 Python 之前仅存在一些文件,使用 进行检查$ ls /dev/nvidia*,在运行设备节点验证脚本后,文件/dev/nvidia-uvm被添加。
| 归档时间: |
|
| 查看次数: |
13594 次 |
| 最近记录: |