导入错误:libcublas.so.10.0:无法打开共享对象文件:没有这样的文件或目录

2023-12-27

我已经在 Ubuntu 18.04 上安装了 Cuda 10.1 和 cudnn,它似乎已正确安装为 nvcc 和 nvidia-smi 类型,我得到了正确的响应:

user:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105
user:~$ nvidia-smi 
Mon Mar 18 14:36:47 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.43       Driver Version: 418.43       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro K5200        Off  | 00000000:03:00.0  On |                  Off |
| 26%   39C    P8    14W / 150W |    225MiB /  8118MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1538      G   /usr/lib/xorg/Xorg                            32MiB |
|    0      1583      G   /usr/bin/gnome-shell                           5MiB |
|    0      3008      G   /usr/lib/xorg/Xorg                           100MiB |
|    0      3120      G   /usr/bin/gnome-shell                          82MiB |
+-----------------------------------------------------------------------------+

我已经使用以下命令安装了张量流:user:~$ sudo pip3 install --upgrade tensorflow-gpu

The directory '/home/amin/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/amin/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: tensorflow-gpu in /usr/local/lib/python3.6/dist-packages (1.13.1)
Requirement already satisfied, skipping upgrade: keras-applications>=1.0.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (1.0.7)
Requirement already satisfied, skipping upgrade: protobuf>=3.6.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (3.6.1)
Requirement already satisfied, skipping upgrade: wheel>=0.26 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (0.32.3)
Requirement already satisfied, skipping upgrade: absl-py>=0.1.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (0.7.0)
Requirement already satisfied, skipping upgrade: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (1.0.9)
Requirement already satisfied, skipping upgrade: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (0.2.2)
Requirement already satisfied, skipping upgrade: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (1.1.0)
Requirement already satisfied, skipping upgrade: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (1.18.0)
Requirement already satisfied, skipping upgrade: tensorflow-estimator<1.14.0rc0,>=1.13.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (1.13.0)
Requirement already satisfied, skipping upgrade: six>=1.10.0 in /usr/lib/python3/dist-packages (from tensorflow-gpu) (1.11.0)
Requirement already satisfied, skipping upgrade: numpy>=1.13.3 in /usr/lib/python3/dist-packages (from tensorflow-gpu) (1.13.3)
Requirement already satisfied, skipping upgrade: astor>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (0.7.1)
Requirement already satisfied, skipping upgrade: tensorboard<1.14.0,>=1.13.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu) (1.13.1)
Requirement already satisfied, skipping upgrade: h5py in /usr/local/lib/python3.6/dist-packages (from keras-applications>=1.0.6->tensorflow-gpu) (2.9.0)
Requirement already satisfied, skipping upgrade: setuptools in /usr/local/lib/python3.6/dist-packages (from protobuf>=3.6.1->tensorflow-gpu) (40.6.3)
Requirement already satisfied, skipping upgrade: mock>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-estimator<1.14.0rc0,>=1.13.0->tensorflow-gpu) (2.0.0)
Requirement already satisfied, skipping upgrade: werkzeug>=0.11.15 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow-gpu) (0.14.1)
Requirement already satisfied, skipping upgrade: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow-gpu) (3.0.1)
Requirement already satisfied, skipping upgrade: pbr>=0.11 in /usr/local/lib/python3.6/dist-packages (from mock>=2.0.0->tensorflow-estimator<1.14.0rc0,>=1.13.0->tensorflow-gpu) (5.1.1)

但是,当我尝试导入tensorflow时,我收到有关libcublas.so.10.0的错误:

user:~$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

我缺少什么?我该如何解决这个问题?

Thanks


我从以下链接下载了cuda 10.0

然后我使用以下命令安装它:

sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda-10-0

然后我通过链接安装了 CUDA 10.0 的 cudnn v7.5.0CUDNN下载 https://developer.nvidia.com/rdp/cudnn-download并且您需要使用帐户登录。

选择正确的版本后,我通过链接下载了CUDNN 电源连接 https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.5.0.56/prod/10.0_20190219/cudnn-10.0-linux-ppc64le-v7.5.0.56.tgz之后我添加了 cudnn 的 include 和 lib 文件,如下所示:

sudo cp -P cuda/targets/ppc64le-linux/include/cudnn.h /usr/local/cuda-10.0/include/
sudo cp -P cuda/targets/ppc64le-linux/lib/libcudnn* /usr/local/cuda-10.0/lib64/
sudo chmod a+r /usr/local/cuda-10.0/lib64/libcudnn*

修改.bashrc中cuda 10.0的lib和路径后,如果没有则需要将它们添加到.bashrc中

export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

经过所有这些步骤,我成功地在 python3 中导入了tensorflow。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

导入错误:libcublas.so.10.0:无法打开共享对象文件:没有这样的文件或目录 的相关文章

随机推荐

  • 添加 FFmpegMediaMetadataRetriever 后 Apk 大小增加

    我将依赖项 com github wseemann FFmpegMediaMetadataRetriever 1 0 3 添加到我的Android Studio中的应用程序 build gradle 中 apk从2 MB跳到16 MB 我只
  • 嘿,如何从 laravel 中的 klaviyo php-sdk 收集 laravel 中的短信同意

    嘿伙计们 有谁知道如何在 klaviyo 中添加短信内容吗 laravel 中的这个包 https github com klaviyo php klaviyo or just add a property to someone 基本上 我
  • 什么时候应该在 Material-UI 中使用 Typography?

    我正在使用 Material UI 但我有点困惑 有这个组件Typography https material ui com components typography typography但我真的不明白何时使用它以及它的目的是什么 什么时
  • 禁用 ScrollView 中包含的 ListView 的滚动

    我想为我的用户显示个人资料屏幕 它必须具有三个视图 2Buttons and a ImageView and a ListView显示该用户制作的内容 但是 我不想要ListView滚动 相反 我希望它尽可能大 并将我所有的观点放在一个Sc
  • 大写 utf8 字符与其小写变体的字节数始终相同吗?

    显然对于拉丁字母来说也是如此 但我是从概念意义上跨语言和 Unicode 规范来问这个问题的 实际上 这是为了比较两个字符串而出现的 如果您已经知道它们在所有语言中的字节数不同 您是否可以认为足以保证它们不是同一字符串的不同 大小写 版本
  • Android IME,在EditText中设置光标位置

    我正在使用软键盘 需要在 IME 编辑文本中设置光标位置 如上图所示 我创建了软键盘 我们可以看到在编辑文本和当前光标位置 由蓝色指示器显示 中输入了一些文本 我需要将光标位置设置在当前行的末尾 在我们的例子中 在图像中首先以红色显示的行的
  • 如何在 Ruby 应用程序中找到未使用的方法?

    我有一个 Ruby 应用程序 其中有很多类 模块 其中一些未使用 有没有一种简单的方法可以找出哪个 我正在考虑做一个配置文件 然后使用它的输出 还有其他想法吗 像 rcov 这样的覆盖工具可能会有所帮助 https github com r
  • 如何在二维图像中的不规则形状上应用纹理?

    我正在尝试从 UIColor 图案图像在 CALayer 上应用纹理 纹理正在应用 但未正确透视转换 看起来我的绘图逻辑存在问题 即我需要使用纹理图像并将其映射到不规则形状 我做了一些研究 发现这件事可以通过 OpenGL 或 Metal
  • TypeORM 选择不区分大小写的不同

    我正在尝试创建一个连接到 postgresql 数据库的 TypeORM 查询生成器以获取数据库中的所有唯一名称 我的查询看起来像这样 names await this context manager getRepository Names
  • 如何在text2vec中对齐两个GloVe模型?

    假设我已经训练了两个独立的 GloVe 向量空间模型 使用text2vec in R 基于两个不同的语料库 这样做可能有不同的原因 例如 两个基础语料库可能来自两个不同的时间段 或者两个非常不同的流派 我有兴趣比较这两个语料库之间单词的用法
  • 删除名称与模式匹配的多个数据库

    我想删除所有以单词开头的数据库 abc xyz cms db1 cms db2 cms xyz pqr 在上面给出的示例中 我想删除所有以 cms 一词开头的数据库 我想 maatkit 或 shell 脚本可以做到这一点 最好的方法是什么
  • 当 SOAP 正文包含 UTF-8 BOM 时出现 JAX-WS 错误

    我使用部署在 WebLogic 10 3 上的 JAX WS v2 1 3 Sun JDK 1 6 0 05 开发了一个 Web 服务 当我使用 Java 客户端或 SoapUI 或其他 Web 服务测试工具时 该服务运行良好 我需要使用
  • 为什么 BigQuery 不显示 Firebase-Analytics 数据?

    我正在使用 BlazePlan 并将我的 firebase 分析帐户与 BigQuery 相关联 尽管已经过去两天多了 我仍然无法在 BigQuery 中看到分析数据 有 Firebase crashlytics firebase mess
  • 如何在 blazor navigator 中将复杂对象作为参数传递

    当尝试传递复杂对象作为参数时 它只传递对象的类型名 导航到不同的组件 页面时传入复杂对象的选项有哪些 这就是我尝试过的 page showLocation SelectedOrgLocation 正在发送信息的页面 navManager N
  • 如何在Kubernetes集群中创建用户?

    我正在尝试在 Kubernetes 集群中创建用户 我使用我的 Terraform 脚本在 DigitalOcean 上旋转了 2 个水滴 然后我使用登录主节点 Dropletssh doctl compute ssh droplet1 接
  • 多处理池的意外行为

    在下面的代码中 我期望输出为 2 因为我在将函数分配给多处理池之前更改了 config 的值 但我得到的是 5 我确信这是有充分理由的 但不知道如何解释 from multiprocessing import Pool config 5 c
  • 更改动态任务中自动生成的任务名称

    我正在尝试创建一个动态工作流程 但想要更改气流自动生成的任务名称并将其分配给列表中的任务 我尝试访问上下文并手动更改taskid但这在 UI 中的管道渲染期间也不起作用 My Code def get the route router ip
  • 如何从 emf 模型生成“带注释的 java 代码”

    更准确地说 我想知道如何将注释建模到 core 模型定义中 这样生成的 java 代码就会包含它们 例如 hibernate 持久性标签 EMF 论坛上的这篇文章讨论了如何使用自定义模板来生成代码 https www eclipse org
  • 如何使用新的 YouTube iframe 样式代码嵌入高质量视频

    我正在使用 youtubes 新的 iframe 代码来嵌入视频 但视频的质量似乎比我在 youtube 上观看的质量要低 有没有办法嵌入高质量的视频 我现在的代码是 vq hd720 或 vq hd1080 解决了其他方法都失败的问题
  • 导入错误:libcublas.so.10.0:无法打开共享对象文件:没有这样的文件或目录

    我已经在 Ubuntu 18 04 上安装了 Cuda 10 1 和 cudnn 它似乎已正确安装为 nvcc 和 nvidia smi 类型 我得到了正确的响应 user nvcc V nvcc NVIDIA R Cuda compile