tensorflow(不是 tensorflow-gpu):调用 cuInit 失败:未知错误(303) [英] tensorflow (not tensorflow-gpu): failed call to cuInit: UNKNOWN ERROR (303)

查看:104
本文介绍了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 1.15.0/1.14.0

我的问题

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

I have reviewed similar issues for example TensorFlow : failed call to cuInit: CUDA_ERROR_NO_DEVICE

关键区别在于我没有安装 tensorflow-gpu 包.普通的 TensorFlow 怎么会出现这个错误?

The key difference is I do not have the tensorflow-gpu package installed. How can this error be raised by normal TensorFlow?

推荐答案

您可以尝试使用 tensorflow-cpu 包而不是 tensorflow 包在仅使用 cpu 的机器上解决此问题.

You can attempt to work around this problem on cpu-only machines by using the tensorflow-cpu package instead of tensorflow.

pip uninstall tensorflow
pip install tensorflow-cpu

这篇关于tensorflow(不是 tensorflow-gpu):调用 cuInit 失败:未知错误(303)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆